diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/quoting.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index a3928b4504..a7a12faac2 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -14,12 +14,12 @@ module ActiveRecord value = value.to_s return "'#{quote_string(value)}'" unless column - if column.type == :binary - "'#{quote_string(column.string_to_binary(value))}'" # ' (for ruby-mode) - elsif [:integer, :float].include?(column.type) - (column.type == :integer ? value.to_i : value.to_f).to_s + case column.type + when :binary then "'#{quote_string(column.string_to_binary(value))}'" + when :integer then value.to_i.to_s + when :float then value.to_f.to_s else - "'#{quote_string(value)}'" # ' (for ruby-mode) + "'#{quote_string(value)}'" end when true, false |