method
references
v2.3.8 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::TableDefinition
references(*args)public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 511
def references(*args)
options = args.extract_options!
polymorphic = options.delete(:polymorphic)
args.each do |col|
column("#{col}_id", :integer, options)
column("#{col}_type", :string, polymorphic.is_a?(Hash) ? polymorphic : options) unless polymorphic.nil?
end
end 1Note
See column
See the end part of the docs on column for example uses.