aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-01-22 15:45:18 +0100
committerJosé Valim <jose.valim@gmail.com>2012-01-22 15:59:31 +0100
commit1f9d6a0bf1307eb45d676b88dcdde87355b5b90d (patch)
tree16b4f76f3b31a6ba5001b65e6aa2d2fa1a1d8210 /railties/lib/rails
parentc3aaacafaa0576d3464b568e8fa693e72699c66d (diff)
downloadrails-1f9d6a0bf1307eb45d676b88dcdde87355b5b90d.tar.gz
rails-1f9d6a0bf1307eb45d676b88dcdde87355b5b90d.tar.bz2
rails-1f9d6a0bf1307eb45d676b88dcdde87355b5b90d.zip
Support decimal{1,2} and decimal{1-2} and decimal{1.2} so it works fine with bash, zsh, etc, closes #4602
Conflicts: railties/test/generators/migration_generator_test.rb
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/generated_attribute.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb
index 96997021ee..29a2ad3111 100644
--- a/railties/lib/rails/generators/generated_attribute.rb
+++ b/railties/lib/rails/generators/generated_attribute.rb
@@ -32,8 +32,8 @@ module Rails
case type
when /(string|text|binary|integer)\{(\d+)\}/
return $1, :limit => $2.to_i
- when /decimal\{(\d+),(\d+)\}/
- return :decimal, :precision => $1.to_i, :scale => $2.to_i
+ when /decimal\{(\d+)(,|\.|\-)(\d+)\}/
+ return :decimal, :precision => $1.to_i, :scale => $3.to_i
else
return type, {}
end