module Sequel::Plugins::AutoRestrictEagerGraph::ClassMethods

  1. lib/sequel/plugins/auto_restrict_eager_graph.rb

Methods

Public Instance

  1. associate

Public Instance methods

associate(type, name, opts = OPTS, &block)

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.

[show source]
   # 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