Module: Sequel::Plugins::ManyToOnePkLookup::ClassMethods
- Defined in:
- lib/sequel/plugins/many_to_one_pk_lookup.rb
Instance Method Summary collapse
-
#def_many_to_one(opts) ⇒ Object
Disable primary key lookup in cases where it will result in a different query than the association query.
Instance Method Details
#def_many_to_one(opts) ⇒ Object
Disable primary key lookup in cases where it will result in a different query than the association query.
26 27 28 29 30 31 32 33 |
# File 'lib/sequel/plugins/many_to_one_pk_lookup.rb', line 26 def def_many_to_one(opts) if !opts.has_key?(:many_to_one_pk_lookup) && (opts[:dataset] || opts[:conditions] || opts[:block] || opts[:select] || (opts.has_key?(:key) && opts[:key] == nil)) opts[:many_to_one_pk_lookup] = false end super end |