aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-07-03 13:24:55 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-07-03 13:25:26 -0300
commit719ea779ea52abd89164ce3f576286a31eccbec9 (patch)
tree60513033920212feb177383d618eedd2e6dfadd3 /activerecord
parent17d2115e3df6caf15d554b44e28177069fa3ed5b (diff)
downloadrails-719ea779ea52abd89164ce3f576286a31eccbec9.tar.gz
rails-719ea779ea52abd89164ce3f576286a31eccbec9.tar.bz2
rails-719ea779ea52abd89164ce3f576286a31eccbec9.zip
Don't need to use delete in the options hash
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb3
2 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index 0706e6ae53..ef17dfbbc5 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -259,7 +259,7 @@ module ActiveRecord
end # end
EOV
end
-
+
# Adds index options to the indexes hash, keyed by column name
# This is primarily used to track indexes that need to be created after the table
#
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 8e43193f4b..65c7ef0153 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -472,9 +472,8 @@ module ActiveRecord
# remove_reference(:products, :supplier, polymorphic: true)
#
def remove_reference(table_name, ref_name, options = {})
- polymorphic = options.delete(:polymorphic)
remove_column(table_name, "#{ref_name}_id")
- remove_column(table_name, "#{ref_name}_type") if polymorphic
+ remove_column(table_name, "#{ref_name}_type") if options[:polymorphic]
end
alias :remove_belongs_to :remove_reference