Pretty urls with to_param and rails sweepers problem


Hi all,

as seems to be quite common, I am overriding to_param for some of my
models to get nicer urls. For example:


instead of


I understand the argument in favor of numeric ids, but in this case I am
using ISO standard codes so I figured that should be OK even for the
most puristic of purists.

It worked just fine for quite a while until I started using sweepers to
clear my page cashes. Turns out that in contrast to url_for, the sweeper
constructs urls using the standard numeric ids instead of my custom
ones, and hence fails to expire the pages correctly.

Is it possible to work around that somehow?