๐ฉโ๐ป Join our community of thousands of amazing developers!
You might have extended classes or instances in Rails, but do you know you can also extend Rails associations? class Account < ActiveRecord::Base has_many :people, -> { extending FindOrCreateByNameExtension } end What exactly does extending an association do? The proxy objects that control access to associations can be extended through anonymous modules. This is especially beneficial for adding new finders, creators, and other factory-type methods that are only used as part of an associ...