Class: ActiveRecord::AssociationRelation
- Defined in:
- lib/active_record/association_relation.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Relation
Relation::CLAUSE_METHODS, Relation::INVALID_METHODS_FOR_DELETE_ALL, Relation::MULTI_VALUE_METHODS, Relation::SINGLE_VALUE_METHODS, Relation::VALUE_METHODS
Constants included from FinderMethods
Constants included from QueryMethods
QueryMethods::FROZEN_EMPTY_ARRAY, QueryMethods::FROZEN_EMPTY_HASH, QueryMethods::VALID_UNSCOPING_VALUES
Constants included from Batches
Batches::DEFAULT_ORDER, Batches::ORDER_IGNORE_MESSAGE
Instance Attribute Summary
Attributes inherited from Relation
#loaded, #model, #predicate_builder, #skip_preloading_value, #table
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(klass, association) ⇒ AssociationRelation
constructor
A new instance of AssociationRelation.
- #proxy_association ⇒ Object
Methods inherited from Relation
#_exec_scope, #alias_tracker, #any?, #bind_attribute, #blank?, #cache_key, #cache_key_with_version, #cache_version, #create, #create!, #create_or_find_by, #create_or_find_by!, #delete, #delete_all, #delete_by, #destroy, #destroy_all, #destroy_by, #eager_loading?, #empty?, #empty_scope?, #encode_with, #explain, #find_or_create_by, #find_or_create_by!, #find_or_initialize_by, #first_or_create, #first_or_create!, #first_or_initialize, #has_limit_or_offset?, #initialize_copy, #insert, #insert!, #insert_all, #insert_all!, #inspect, #joined_includes_values, #load, #load_async, #many?, #new, #none?, #one?, #preload_associations, #pretty_print, #readonly?, #records, #reload, #reset, #scheduled?, #scope_for_create, #scoping, #size, #then, #to_ary, #to_sql, #touch_all, #update, #update!, #update_all, #update_counters, #upsert, #upsert_all, #values, #values_for_queries, #where_values_hash
Methods included from SignedId::RelationMethods
Methods included from TokenFor::RelationMethods
#find_by_token_for, #find_by_token_for!
Methods included from FinderMethods
#exists?, #fifth, #fifth!, #find, #find_by, #find_by!, #find_sole_by, #first, #first!, #forty_two, #forty_two!, #fourth, #fourth!, #include?, #last, #last!, #raise_record_not_found_exception!, #second, #second!, #second_to_last, #second_to_last!, #sole, #take, #take!, #third, #third!, #third_to_last, #third_to_last!
Methods included from Calculations
#async_average, #async_count, #async_ids, #async_maximum, #async_minimum, #async_pick, #async_pluck, #async_sum, #average, #calculate, #count, #ids, #maximum, #minimum, #pick, #pluck, #sum
Methods included from SpawnMethods
#except, #merge, #merge!, #only, #spawn
Methods included from QueryMethods
#_select!, #all, #and, #and!, #annotate, #annotate!, #arel, #construct_join_dependency, #create_with, #create_with!, #distinct, #distinct!, #eager_load, #eager_load!, #excluding, #excluding!, #extending, #extending!, #extract_associated, #from, #from!, #group, #group!, #having, #having!, #in_order_of, #includes, #includes!, #invert_where, #invert_where!, #joins, #joins!, #left_outer_joins, #left_outer_joins!, #limit, #limit!, #lock, #lock!, #none, #none!, #null_relation?, #offset, #offset!, #optimizer_hints, #optimizer_hints!, #or, #or!, #order, #order!, #preload, #preload!, #readonly, #readonly!, #references, #references!, #regroup, #regroup!, #reorder, #reorder!, #reselect, #reselect!, #reverse_order, #reverse_order!, #rewhere, #select, #skip_preloading!, #skip_query_cache!, #strict_loading, #strict_loading!, #structurally_compatible?, #uniq!, #unscope, #unscope!, #where, #where!, #with, #with!, #with_recursive, #with_recursive!
Methods included from Batches
#find_each, #find_in_batches, #in_batches
Methods included from Explain
#collecting_queries_for_explain, #exec_explain
Methods included from Delegation
delegated_classes, uncacheable_methods
Constructor Details
#initialize(klass, association) ⇒ AssociationRelation
Returns a new instance of AssociationRelation.
5 6 7 8 |
# File 'lib/active_record/association_relation.rb', line 5 def initialize(klass, association, **) super(klass) @association = association end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/active_record/association_relation.rb', line 14 def ==(other) other == records end |
#proxy_association ⇒ Object
10 11 12 |
# File 'lib/active_record/association_relation.rb', line 10 def proxy_association @association end |