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
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
I hope my question makes sense!