Class: ActiveRecord::Associations::Builder::DeprecatedOptionsProc
- Inherits:
-
Object
- Object
- ActiveRecord::Associations::Builder::DeprecatedOptionsProc
- Defined in:
- lib/active_record/deprecated_finders/association_builder.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #arity ⇒ Object
-
#initialize(options) ⇒ DeprecatedOptionsProc
constructor
A new instance of DeprecatedOptionsProc.
- #to_proc ⇒ Object
Constructor Details
#initialize(options) ⇒ DeprecatedOptionsProc
Returns a new instance of DeprecatedOptionsProc.
9 10 11 12 13 14 |
# File 'lib/active_record/deprecated_finders/association_builder.rb', line 9 def initialize() [:includes] = .delete(:include) if [:include] [:where] = .delete(:conditions) if [:conditions] @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/active_record/deprecated_finders/association_builder.rb', line 7 def @options end |
Instance Method Details
#arity ⇒ Object
29 30 31 |
# File 'lib/active_record/deprecated_finders/association_builder.rb', line 29 def arity 1 end |
#to_proc ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/active_record/deprecated_finders/association_builder.rb', line 16 def to_proc = self. proc do |owner| if [:where].respond_to?(:to_proc) context = owner || self where(context.instance_eval(&[:where])) .merge!(.except(:where)) else merge() end end end |