Merge pull request #10010 from pwnall/fix_ref_index_true

Make references with index:true pass Hash options to add_index
This commit is contained in:
Rafael Mendonça França 2013-04-01 10:29:46 -07:00
commit 456bd7bfad

@ -258,7 +258,7 @@ def references(*args)
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