Subscribe to my Feed, follow me on Twitter, recommend me on Working With Rails or see my code on GitHub
Comment
You're viewing a comment to the page ActsAsSluggable
Subscribe to my Feed, follow me on Twitter, recommend me on Working With Rails or see my code on GitHub
You're viewing a comment to the page ActsAsSluggable
Tear down the house and build a boat!
Abandon wealth and seek living beings!
Spurn possessions and keep alive living beings!
By Tore Darell at Sat 12 Jul 13:51
Tauruz: All acts_as_sluggable did was define a default
to_paramwith some simple replacement and patchActiveRecord::Base#findto be able to find a record by ID with a string like “10-foo-bar”. AR doesn’t need this patch anymore, and defining ato_parammethod on a model is not much more work than addingacts_as_sluggableto it. As a bonus, you know exactly how yourto_paramworks and can modify it without having to look deep inside a plugin directory to find it.