Class: ActiveRecord::Reflection::PolymorphicReflection
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
AbstractReflection
|
|
Instance Chain:
self,
AbstractReflection
|
|
Inherits: |
ActiveRecord::Reflection::AbstractReflection
|
Defined in: | activerecord/lib/active_record/reflection.rb |
Class Method Summary
AbstractReflection
- Inherited
Instance Attribute Summary
- #join_foreign_key readonly
- #join_primary_key readonly
- #klass readonly
- #name readonly
- #plural_name readonly
- #scope readonly
- #scope_for readonly
- #type readonly
AbstractReflection
- Inherited
#counter_must_be_updated_by_has_many?, | |
#has_active_cached_counter? | Returns whether this association has a counter cache and its column values were backfilled (and so it is used internally by methods like |
#has_cached_counter? | Returns whether this association has a counter cache. |
#inverse_updates_counter_cache? | |
#inverse_updates_counter_in_memory?, #strict_loading?, #through_reflection? |
Instance Method Summary
- #constraints
- #join_scopes(table, predicate_builder = nil, klass = self.klass, record = nil)
- #source_type_scope private
AbstractReflection
- Inherited
#alias_candidate, | |
#build_association | Returns a new, unsaved instance of the associated class. |
#build_scope, #chain, #check_validity_of_inverse!, | |
#class_name | Returns the class name for the macro. |
#constraints, #counter_cache_column, #inverse_of, | |
#inverse_which_updates_counter_cache | We need to avoid the following situation: |
#join_scope, #join_scopes, #klass_join_scope, | |
#scopes | Returns a list of scopes that should be applied for this |
#strict_loading_violation_message, #table_name, | |
#actual_source_reflection | FIXME: this is a horrible name. |
#ensure_option_not_given_as_class!, #primary_key |
Constructor Details
.new(reflection, previous_reflection) ⇒ PolymorphicReflection
# File 'activerecord/lib/active_record/reflection.rb', line 1232
def initialize(reflection, previous_reflection) super() @reflection = reflection @previous_reflection = previous_reflection end
Instance Attribute Details
#join_foreign_key (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
#join_primary_key (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
#klass (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
#name (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
#plural_name (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
#scope (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
#scope_for (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
#type (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1229
delegate :klass, :scope, :plural_name, :type, :join_primary_key, :join_foreign_key, :name, :scope_for, to: :@reflection
Instance Method Details
#constraints
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1246
def constraints @reflection.constraints + [source_type_scope] end
#join_scopes(table, predicate_builder = nil, klass = self.klass, record = nil)
[ GitHub ]# File 'activerecord/lib/active_record/reflection.rb', line 1238
def join_scopes(table, predicate_builder = nil, klass = self.klass, record = nil) # :nodoc: scopes = super unless @previous_reflection.through_reflection? scopes += @previous_reflection.join_scopes(table, predicate_builder, klass, record) end scopes << build_scope(table, predicate_builder, klass).instance_exec(record, &source_type_scope) end