Class: ActiveRecord::Reflection::PolymorphicReflection
- Inherits:
-
AbstractReflection
- Object
- AbstractReflection
- ActiveRecord::Reflection::PolymorphicReflection
- Defined in:
- lib/active_record/reflection.rb
Overview
:nodoc:
Instance Method Summary collapse
- #constraints ⇒ Object
-
#initialize(reflection, previous_reflection) ⇒ PolymorphicReflection
constructor
A new instance of PolymorphicReflection.
-
#join_scopes(table, predicate_builder, klass = self.klass) ⇒ Object
:nodoc:.
Methods inherited from AbstractReflection
#alias_candidate, #build_association, #build_scope, #chain, #check_validity_of_inverse!, #class_name, #counter_cache_column, #counter_must_be_updated_by_has_many?, #has_cached_counter?, #inverse_of, #inverse_updates_counter_in_memory?, #inverse_which_updates_counter_cache, #join_scope, #klass_join_scope, #scopes, #strict_loading?, #table_name, #through_reflection?
Constructor Details
#initialize(reflection, previous_reflection) ⇒ PolymorphicReflection
Returns a new instance of PolymorphicReflection.
1011 1012 1013 1014 |
# File 'lib/active_record/reflection.rb', line 1011 def initialize(reflection, previous_reflection) @reflection = reflection @previous_reflection = previous_reflection end |
Instance Method Details
#constraints ⇒ Object
1021 1022 1023 |
# File 'lib/active_record/reflection.rb', line 1021 def constraints @reflection.constraints + [source_type_scope] end |
#join_scopes(table, predicate_builder, klass = self.klass) ⇒ Object
:nodoc:
1016 1017 1018 1019 |
# File 'lib/active_record/reflection.rb', line 1016 def join_scopes(table, predicate_builder, klass = self.klass) # :nodoc: scopes = @previous_reflection.join_scopes(table, predicate_builder) + super scopes << build_scope(table, predicate_builder, klass).instance_exec(nil, &source_type_scope) end |