Make references with index:true pass Hash options to add_index.
This commit is contained in:
parent
3b0b573ac3
commit
ad90620094
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user