module Sequel::Plugins::AssociationProxies::ClassMethods

Attributes

association_proxy_to_dataset[R]

Proc that accepts a method name, array of arguments, and block and should return a truthy value to send the method to the dataset instead of the array of associated objects.

Private Instance Methods

def_association_method(opts) click to toggle source

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

Calls superclass method
    # File lib/sequel/plugins/association_proxies.rb
117 def def_association_method(opts)
118   if opts.returns_array?
119     association_module_def(opts.association_method, opts) do |dynamic_opts=OPTS, &block|
120       AssociationProxy.new(self, opts, dynamic_opts, &block)
121     end
122   else
123     super
124   end
125 end