Permalink
Browse files

Merge pull request #10010 from pwnall/fix_ref_index_true

Make references with index:true pass Hash options to add_index
  • Loading branch information...
rafaelfranca committed Apr 1, 2013
2 parents b2f62f5 + ad90620 commit 456bd7bfade62c6057649fb57a254fa931276470
@@ -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

0 comments on commit 456bd7b

Please sign in to comment.