Module Sequel::Plugins::ClassMethods
In: lib/sequel/plugins/association_proxies.rb

Methods

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.

Public Instance methods

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

[Source]

     # File lib/sequel/plugins/association_proxies.rb, line 113
113:         def def_association_method(opts)
114:           if opts.returns_array?
115:             association_module_def(opts.association_method, opts) do |dynamic_opts=OPTS, &block|
116:               AssociationProxy.new(self, opts, dynamic_opts, &block)
117:             end
118:           else
119:             super
120:           end
121:         end

[Validate]