How do rails association methods work?
How it actually works is that the association object is a “proxy object”. The specific class is AssociationProxy. If you look at line 52 of that file, you’ll see: instance_methods.each { |m| undef_method m unless m =~ /(^__|^nil\?$|^send$|proxy_|^object_id$)/ } By doing this, methods like class no longer exist on this object. So if you call … Read more