instance method
remove_references
Ruby on Rails 3.1.12
Since v2.2.3Signature
remove_references(*args)
Removes a reference. Optionally removes a type column. remove_references and remove_belongs_to are acceptable.
Examples
t.remove_references(:goat) t.remove_references(:goat, :polymorphic => true) t.remove_belongs_to(:goat)
Parameters
-
argsrest
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 437
def remove_references(*args)
options = args.extract_options!
polymorphic = options.delete(:polymorphic)
args.each do |col|
@base.remove_column(@table_name, "#{col}_id")
@base.remove_column(@table_name, "#{col}_type") unless polymorphic.nil?
end
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb line 437
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Table