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
50 def associate(type, name, opts = OPTS, &block)
51   opts = super
52 
53   if opts[:block] && !opts.has_key?(:allow_eager_graph) && !opts[:orig_opts].any?{|k,| /\Agraph_/ =~ k}
54     opts[:allow_eager_graph] = false
55   end
56 
57   opts
58 end