Oh one just has to adore the dynamic nature of Ruby coupled with the thoughtfulness of Rails.
I have a Feedtag object which has feed_id and tag_id members. Naturally with Rails you get to be able to find records using Feedtag.find_by_tag_id and Feedtag.find_by_feed_id. But what if you wanted to use both Ids to find a record?
No problem. Just use Feedtag.find_by_tag_id_and_feed_id. It is a bit of a mouthful but it works. No extra code, no SQL strings, just a bit of beautiful dynamic code.
Add New Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)