diff options
author | Xavier Noria <fxn@hashref.com> | 2012-01-30 13:13:04 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-01-30 13:13:04 -0800 |
commit | 7619bcf2d4a348cb48b765e1980e935abbcc694f (patch) | |
tree | 823498f90b5a84d070b892f0e411b06ff3ac4639 /railties | |
parent | 211174a3be8554d54f2df140e601b8d39cc89824 (diff) | |
download | rails-7619bcf2d4a348cb48b765e1980e935abbcc694f.tar.gz rails-7619bcf2d4a348cb48b765e1980e935abbcc694f.tar.bz2 rails-7619bcf2d4a348cb48b765e1980e935abbcc694f.zip |
rewrites a couple of alternations in regexps as character classes
Character classes are the specific regexp construct
to express alternation of individual characters.
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 29a2ad3111..51787c30df 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -32,7 +32,7 @@ module Rails case type when /(string|text|binary|integer)\{(\d+)\}/ return $1, :limit => $2.to_i - when /decimal\{(\d+)(,|\.|\-)(\d+)\}/ + when /decimal\{(\d+)[,.-](\d+)\}/ return :decimal, :precision => $1.to_i, :scale => $3.to_i else return type, {} |