Sneaky Abstractions

Subscribe to my Feed, follow me on , recommend me on Working With Rails or see my code on GitHub

Listing comments to ActsAsSluggable.

By mijnopenid.nl/tilsammans at

I don’t nessesarily agree that acts_as_sluggable is ‘worthless’. As you say, it’s easy to define to_param. But to define it in several models?

So ‘DRY-fanatics’ can just build a lib. Yes sure, but having it a plugin is more convenient. I have models with head, title, name and your plugin supports all of those things fine.

Therefore: i vote to keep acts_as_sluggable alive. It might be useless to you, but is not to me!

By Tore Darell at

Well, the plugin is still available from SVN, and I think it’s quite stable (i.e. no bugs and no planned features), so if you find it useful I’m not going to stop you from using it :)

By tauraz at

Can you please explain, how completely to_params replaced acts_as_sluggable.

By Tore Darell at

Tauruz: All acts_as_sluggable did was define a default to_param with some simple replacement and patch ActiveRecord::Base#find to be able to find a record by ID with a string like “10-foo-bar”. AR doesn’t need this patch anymore, and defining a to_param method on a model is not much more work than adding acts_as_sluggable to it. As a bonus, you know exactly how your to_param works and can modify it without having to look deep inside a plugin directory to find it.

New comment

OpenID

Or..

Old school

I’m Sheriff John Bunnell, when you hear police sirens it means one of two things; someone is in trouble or someone is causing trouble. In the next hour, we’re gonna show you trouble, up close, the way the police see it every single day. So fasten your seatbelts, we’re gonna take you for a wild ride.