edge badge
Methods
C
N
Included Modules
Instance Public methods
const_missing(name)

This doesn’t have to be thread-safe. relation_class_for guarantees that this will only be called exactly once for a given const name.

# File activerecord/lib/active_record/relation/delegation.rb, line 84
def const_missing(name)
  const_set(name, Class.new(self) { include ClassSpecificRelation })
end
new(klass, *args)
# File activerecord/lib/active_record/relation/delegation.rb, line 76
def new(klass, *args)
  relation = relation_class_for(klass).allocate
  relation.__send__(:initialize, klass, *args)
  relation
end