Class: ActiveRecord::AssociationRelation
- Defined in:
- activerecord/lib/active_record/association_relation.rb
Constant Summary
Constants inherited from Relation
Relation::MULTI_VALUE_METHODS, Relation::SINGLE_VALUE_METHODS, Relation::VALUE_METHODS
Constants included from FinderMethods
Constants included from QueryMethods
QueryMethods::VALID_UNSCOPING_VALUES
Constants included from Delegation
Delegation::BLACKLISTED_ARRAY_METHODS
Instance Attribute Summary
Attributes inherited from Relation
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(klass, table, association) ⇒ AssociationRelation
constructor
A new instance of AssociationRelation.
- #proxy_association ⇒ Object
Methods inherited from Relation
#_update_record, #any?, #as_json, #blank?, #create, #create!, #delete, #delete_all, #destroy, #destroy_all, #eager_loading?, #empty?, #explain, #find_or_create_by, #find_or_create_by!, #find_or_initialize_by, #first_or_create, #first_or_create!, #first_or_initialize, #initialize_copy, #insert, #inspect, #joined_includes_values, #load, #many?, #new, #pretty_print, #reload, #reset, #scope_for_create, #scoping, #size, #substitute_values, #to_a, #to_sql, #uniq_value, #update, #update_all, #values, #where_values_hash
Methods included from FinderMethods
#exists?, #fifth, #fifth!, #find, #find_by, #find_by!, #first, #first!, #forty_two, #forty_two!, #fourth, #fourth!, #last, #last!, #raise_record_not_found_exception!, #second, #second!, #take, #take!, #third, #third!
Methods included from Calculations
#average, #calculate, #count, #ids, #maximum, #minimum, #pluck, #sum
Methods included from SpawnMethods
#except, #merge, #merge!, #only, #spawn
Methods included from QueryMethods
#_select!, #arel, #bind, #bind!, #create_with, #create_with!, #create_with_value, #distinct, #distinct!, #eager_load, #eager_load!, #extending, #extending!, #from, #from!, #group, #group!, #having, #having!, #includes, #includes!, #joins, #joins!, #limit, #limit!, #lock, #lock!, #none, #none!, #offset, #offset!, #order, #order!, #preload, #preload!, #readonly, #readonly!, #references, #references!, #reorder, #reorder!, #reverse_order, #reverse_order!, #rewhere, #select, #unscope, #unscope!, #where, #where!
Methods included from ActiveSupport::Concern
#append_features, extended, #included
Methods included from Batches
Methods included from Explain
#collecting_queries_for_explain, #exec_explain
Methods included from Delegation
Constructor Details
#initialize(klass, table, association) ⇒ AssociationRelation
Returns a new instance of AssociationRelation.
3 4 5 6 |
# File 'activerecord/lib/active_record/association_relation.rb', line 3 def initialize(klass, table, association) super(klass, table) @association = association end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveRecord::Delegation
Instance Method Details
#==(other) ⇒ Object
12 13 14 |
# File 'activerecord/lib/active_record/association_relation.rb', line 12 def ==(other) other == to_a end |
#proxy_association ⇒ Object
8 9 10 |
# File 'activerecord/lib/active_record/association_relation.rb', line 8 def proxy_association @association end |