diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-01 10:29:46 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-01 10:29:46 -0700 |
commit | 456bd7bfade62c6057649fb57a254fa931276470 (patch) | |
tree | e896965ba146d0cc35a175685c4a71b8c96882f8 /activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | |
parent | b2f62f54f560490f337e0c22755922283e4c3557 (diff) | |
parent | ad906200948e1359cc5eb06fbbd9aeeb383bb48b (diff) | |
download | rails-456bd7bfade62c6057649fb57a254fa931276470.tar.gz rails-456bd7bfade62c6057649fb57a254fa931276470.tar.bz2 rails-456bd7bfade62c6057649fb57a254fa931276470.zip |
Merge pull request #10010 from pwnall/fix_ref_index_true
Make references with index:true pass Hash options to add_index
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb')
-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 |