class ActiveRecord::Associations::AssociationScope
def next_chain_scope(scope, reflection, next_reflection)
Experimental RBS support (using type sampling data from the type_fusion
project).
def next_chain_scope: (Account::ActiveRecord_Relation scope, ActiveRecord::Reflection::RuntimeReflection reflection, ActiveRecord::Associations::AssociationScope::ReflectionProxy next_reflection) -> Account::ActiveRecord_Relation
This signature was generated using 1 sample from 1 application.
def next_chain_scope(scope, reflection, next_reflection) primary_key = reflection.join_primary_key foreign_key = reflection.join_foreign_key table = reflection.aliased_table foreign_table = next_reflection.aliased_table constraint = table[primary_key].eq(foreign_table[foreign_key]) if reflection.type value = transform_value(next_reflection.klass.polymorphic_name) scope = apply_scope(scope, table, reflection.type, value) end scope.joins!(join(foreign_table, constraint)) end