Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5882 from vijaydev/fix_generated_attribute_build

Fixing the build
  • Loading branch information...
commit e3a3a14ce78ad0319f263b7fc434be1567c6bc52 2 parents 3b0ffb1 + 938464d
@spastorino spastorino authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 railties/lib/rails/generators/generated_attribute.rb
View
6 railties/lib/rails/generators/generated_attribute.rb
@@ -22,8 +22,10 @@ def parse(column_definition)
type, attr_options = *parse_type_and_options(type)
- 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
+ if type.in?(%w(references belongs_to))
+ references_index = UNIQ_INDEX_OPTIONS.include?(has_index) ? {:unique => true} : true
+ attr_options.merge!({:index => references_index})
+ end
new(name, type, has_index, attr_options)
end

0 comments on commit e3a3a14

Please sign in to comment.
Something went wrong with that request. Please try again.