lib/rails/generators/generated_attribute.rb in railties-5.0.0.beta1.1 vs lib/rails/generators/generated_attribute.rb in railties-5.0.0.beta2
- old
+ new
@@ -21,11 +21,12 @@
type, attr_options = *parse_type_and_options(type)
type = type.to_sym if type
if type && reference?(type)
- references_index = UNIQ_INDEX_OPTIONS.include?(has_index) ? { unique: true } : true
- attr_options[:index] = references_index
+ if UNIQ_INDEX_OPTIONS.include?(has_index)
+ attr_options[:index] = { unique: true }
+ end
end
new(name, type, has_index, attr_options)
end