diff options
author | Victor Costan <costan@gmail.com> | 2013-04-01 13:14:38 -0400 |
---|---|---|
committer | Victor Costan <costan@gmail.com> | 2013-04-01 13:14:38 -0400 |
commit | ad906200948e1359cc5eb06fbbd9aeeb383bb48b (patch) | |
tree | d834a226590c604078be7de328a98544a9456f93 /activerecord | |
parent | 3b0b573ac3ecbec5b1fa021abbe86b267bbefb8c (diff) | |
download | rails-ad906200948e1359cc5eb06fbbd9aeeb383bb48b.tar.gz rails-ad906200948e1359cc5eb06fbbd9aeeb383bb48b.tar.bz2 rails-ad906200948e1359cc5eb06fbbd9aeeb383bb48b.zip |
Make references with index:true pass Hash options to add_index.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 2 |
1 files changed, 1 insertions, 1 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 eb974e4a6e..566550cbe2 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -258,7 +258,7 @@ module ActiveRecord args.each do |col| column("#{col}_id", :integer, options) column("#{col}_type", :string, polymorphic.is_a?(Hash) ? polymorphic : options) if polymorphic - index(polymorphic ? %w(id type).map { |t| "#{col}_#{t}" } : "#{col}_id", index_options.is_a?(Hash) ? index_options : nil) if index_options + index(polymorphic ? %w(id type).map { |t| "#{col}_#{t}" } : "#{col}_id", index_options.is_a?(Hash) ? index_options : {}) if index_options end end alias :belongs_to :references |