module Sequel::Plugins::AutoRestrictEagerGraph::ClassMethods

Public Instance Methods

associate(type, name, opts = OPTS, &block) click to toggle source

When defining an association, if a block is given for the association, but a :graph_* option is not used, disallow the use of eager_graph.

Calls superclass method
   # File lib/sequel/plugins/auto_restrict_eager_graph.rb
52 def associate(type, name, opts = OPTS, &block)
53   opts = super
54 
55   if opts[:block] && !opts.has_key?(:allow_eager_graph) && !opts[:orig_opts].any?{|k,| /\Agraph_/ =~ k}
56     opts[:allow_eager_graph] = false
57   end
58 
59   opts
60 end