diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql/quoting.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql/quoting.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb index 7c5980da2a..c19889dcd0 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb @@ -10,8 +10,26 @@ module ActiveRecord @quoted_table_names[name] ||= super.gsub('.', '`.`') end + def quoted_true + QUOTED_TRUE + end + + def unquoted_true + 1 + end + + def quoted_false + QUOTED_FALSE + end + + def unquoted_false + 0 + end + private + QUOTED_TRUE, QUOTED_FALSE = '1', '0' + def _quote(value) if value.is_a?(Type::Binary::Data) "x'#{value.hex}'" |