Module: ActiveRecord::ConnectionAdapters::MySQL::Quoting
- Included in:
- AbstractMysqlAdapter
- Defined in:
- lib/active_record/connection_adapters/mysql/quoting.rb
Overview
:nodoc:
Instance Method Summary collapse
- #column_name_matcher ⇒ Object
- #column_name_with_order_matcher ⇒ Object
- #quote_column_name(name) ⇒ Object
- #quote_table_name(name) ⇒ Object
- #quoted_binary(value) ⇒ Object
- #quoted_date(value) ⇒ Object
- #unquoted_false ⇒ Object
- #unquoted_true ⇒ Object
Instance Method Details
#column_name_matcher ⇒ Object
37 38 39 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 37 def column_name_matcher COLUMN_NAME end |
#column_name_with_order_matcher ⇒ Object
41 42 43 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 41 def column_name_with_order_matcher COLUMN_NAME_WITH_ORDER end |
#quote_column_name(name) ⇒ Object
9 10 11 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 9 def quote_column_name(name) self.class.quoted_column_names[name] ||= "`#{super.gsub('`', '``')}`" end |
#quote_table_name(name) ⇒ Object
13 14 15 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 13 def quote_table_name(name) self.class.quoted_table_names[name] ||= super.gsub(".", "`.`").freeze end |
#quoted_binary(value) ⇒ Object
33 34 35 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 33 def quoted_binary(value) "x'#{value.hex}'" end |
#quoted_date(value) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 25 def quoted_date(value) if supports_datetime_with_precision? super else super.sub(/\.\d{6}\z/, "") end end |
#unquoted_false ⇒ Object
21 22 23 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 21 def unquoted_false 0 end |
#unquoted_true ⇒ Object
17 18 19 |
# File 'lib/active_record/connection_adapters/mysql/quoting.rb', line 17 def unquoted_true 1 end |