method
new
v7.1.3.4 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::ReferenceDefinition
new( name, polymorphic: false, index: true, foreign_key: false, type: :bigint, **options )public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 196
def initialize(
name,
polymorphic: false,
index: true,
foreign_key: false,
type: :bigint,
**options
)
@name = name
@polymorphic = polymorphic
@index = index
@foreign_key = foreign_key
@type = type
@options = options
if polymorphic && foreign_key
raise ArgumentError, "Cannot add a foreign key to a polymorphic relation"
end
end