Module: Sequel::Plugins::AssociationProxies::ClassMethods

Defined in:
lib/sequel/lib/sequel/plugins/association_proxies.rb

Instance Method Summary collapse

Instance Method Details

#def_association_method(opts) ⇒ Object

Changes the association method to return a proxy instead of the associated objects directly.


35
36
37
# File 'lib/sequel/lib/sequel/plugins/association_proxies.rb', line 35

def def_association_method(opts)
  opts.returns_array? ? association_module_def(opts.association_method){|*r| AssociationProxy.new(self, opts, r[0])} : super
end