method
new
v4.1.8 -
Show latest stable
- Class:
ActiveRecord::Reflection::AssociationReflection
new(macro, name, scope, options, active_record)public
No documentation available.
# File activerecord/lib/active_record/reflection.rb, line 227
def initialize(macro, name, scope, options, active_record)
super
@collection = [:has_many, :has_and_belongs_to_many].include?(macro)
@automatic_inverse_of = nil
@type = options[:as] && "#{options[:as]}_type"
@foreign_type = options[:foreign_type] || "#{name}_type"
@constructable = calculate_constructable(macro, options)
end