Single table inheritance strangeness
Posted by jacqui maher on April 29, 2008 at 10:19 PM
I suppose “special” is a word for this behavior. I would have expected a constraint used in find_by_id to also be used in find. Right.
>> Asset.find_by_id(params[:id])
# => nil
log: Asset Load (0.009816) SELECT * FROM assets WHERE (assets.`id` = ‘8515’) AND ( (assets.`class_name` = ‘Asset’ ) ) LIMIT 1
>> Asset.find(params[:id])
# => #
log: BaseAsset Load (0.000528) SELECT * FROM assets WHERE (assets.`id` = 8515)
Comments
There are 0 comments on this post. Post yours →
Post a comment
Required fields in bold.