Skip to content

Commit

Permalink
Let float have an incrementing number
Browse files Browse the repository at this point in the history
If a model has 2 float attributes, the auto generated
tests are failing ones because of duplicate value.
  • Loading branch information
Alwahsh committed Feb 8, 2016
1 parent 8aef271 commit 50b4ec8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/generators/rspec/scaffold/scaffold_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def raw_value_for(attribute)
case attribute.type
when :string
attribute.name.titleize
when :integer
when :integer, :float
@attribute_id_map ||= {}
@attribute_id_map[attribute] ||= @attribute_id_map.keys.size.next
@attribute_id_map[attribute] ||= @attribute_id_map.keys.size.next + attribute.default
else
attribute.default
end
Expand Down

0 comments on commit 50b4ec8

Please sign in to comment.