From: Eduardo Scoz Date: 2007-01-18T03:47:01+09:00 Subject: ActiveRecord find_by_*() - how does it work? Hi guys! I've been trying to understand how the find_by_*() method on ActiveRecord works, but couldn't find anything that could help. I think that you guys can probably help me on that. On Active Record, you can make a call like user.find_by_first_name_and_last_name("eduardo"...) and this will generate the sql to send to the database. But how does that method gets created? ActiveRecord doesn't know what I want to find until I actually make the call, and the number of different combinations of parameters would probably be infinite for it to be created during the object initialization, so (I imagine) the method must be created __AFTER__ it was called. So my question is, is it possible for an object to receive a call to a method that doesn't exist, not throw a NoMethodError, and respond to that call? I hope my question makes sense! :) Thank you!!! -- Posted via http://www.ruby-forum.com/.