aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-04-17 13:51:50 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2012-04-17 13:51:50 -0700
commite3a3a14ce78ad0319f263b7fc434be1567c6bc52 (patch)
tree79156cc6457df6e83cb0a5a6e213b69a9258fd9f
parent3b0ffb1efd9d70bf89571d720d994425ba428419 (diff)
parent938464d475877377bb84512930f0a96953f63f57 (diff)
downloadrails-e3a3a14ce78ad0319f263b7fc434be1567c6bc52.tar.gz
rails-e3a3a14ce78ad0319f263b7fc434be1567c6bc52.tar.bz2
rails-e3a3a14ce78ad0319f263b7fc434be1567c6bc52.zip
Merge pull request #5882 from vijaydev/fix_generated_attribute_build
Fixing the build
-rw-r--r--railties/lib/rails/generators/generated_attribute.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb
index 21167359cc..50e7aa85ac 100644
--- a/railties/lib/rails/generators/generated_attribute.rb
+++ b/railties/lib/rails/generators/generated_attribute.rb
@@ -22,8 +22,10 @@ module Rails
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