Fix regexp intervals.

This commit is contained in:
José Valim
2011-12-24 12:53:27 +01:00
parent fc4299805e
commit 1db5f4e9ad

View File

@@ -27,9 +27,9 @@ module Rails
# when declaring options curly brackets should be used
def parse_type_and_options(type)
case type
when /(string|text|binary|integer){(\d+)}/
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 => $2.to_i
else
return type, {}