I’ve been trying to find the source code so I can understand how ActiveRecord dynamic attribute-based finders work. I haven’t been able to find where in the source code the definitions live.
Could someone put me to the location in the file(s) that define this functionality? Thanks!
Using Rails 3.2.5
I looked in ActiveRecord::Model and noticed that there was a module included called DynamicMatchers. It looks like this is where all the dynamic attribute finders come from. Essentially it’s using method missing and reflecting back on the associated model:
https://github.com/rails/rails/blob/master/activerecord/lib/active_record/dynamic_matchers.rb