Skip to content

Commit

Permalink
use regular expression or statement. loltargetrichenvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 5, 2012
1 parent 071c8bf commit 8e051a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/schema_dumper.rb
Expand Up @@ -112,7 +112,7 @@ def table(table, stream)

# AR has an optimization which handles zero-scale decimals as integers. This
# code ensures that the dumper still dumps the column as a decimal.
spec[:type] = if column.type == :integer && [/^numeric/, /^decimal/].any? { |e| e.match(column.sql_type) }
spec[:type] = if column.type == :integer && /^(numeric|decimal)/ =~ column.sql_type
'decimal'
else
column.type.to_s
Expand Down

0 comments on commit 8e051a1

Please sign in to comment.