diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/generated_attribute.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index 7296068f04..21167359cc 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -22,7 +22,7 @@ module Rails type, attr_options = *parse_type_and_options(type) - references_index = (type.in?(%w(references belongs_to)) and UNIQ_INDEX_OPTIONS.include?(has_index) ? {:unique => true} : true) + references_index = type.in?(%w(references belongs_to)) && UNIQ_INDEX_OPTIONS.include?(has_index) ? {:unique => true} : true attr_options.merge!({:index => references_index}) if references_index new(name, type, has_index, attr_options) |