Module: ActiveRecord::ConnectionAdapters::Peasys::Quoting
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActiveRecord::ConnectionAdapters::PeasysAdapter
- Defined in:
- lib/active_record/connection_adapters/peasys/quoting.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- QUOTED_COLUMN_NAMES =
:nodoc:
Concurrent::Map.new
- QUOTED_TABLE_NAMES =
:nodoc:
Concurrent::Map.new
Instance Method Summary collapse
- #quote_string(s) ⇒ Object
- #quote_table_name_for_assignment(_table, attr) ⇒ Object
- #quoted_date(value) ⇒ Object
- #quoted_false ⇒ Object
- #quoted_true ⇒ Object
- #unquoted_false ⇒ Object
- #unquoted_true ⇒ Object
Instance Method Details
#quote_string(s) ⇒ Object
55 56 57 |
# File 'lib/active_record/connection_adapters/peasys/quoting.rb', line 55 def quote_string(s) s.gsub("'", "''") end |
#quote_table_name_for_assignment(_table, attr) ⇒ Object
83 84 85 |
# File 'lib/active_record/connection_adapters/peasys/quoting.rb', line 83 def quote_table_name_for_assignment(_table, attr) quote_column_name(attr) end |
#quoted_date(value) ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/active_record/connection_adapters/peasys/quoting.rb', line 75 def quoted_date(value) if value.acts_like?(:time) value.strftime("%Y-%m-%d %H:%M:%S.%6N") else value.to_s end end |
#quoted_false ⇒ Object
67 68 69 |
# File 'lib/active_record/connection_adapters/peasys/quoting.rb', line 67 def quoted_false "0" end |
#quoted_true ⇒ Object
59 60 61 |
# File 'lib/active_record/connection_adapters/peasys/quoting.rb', line 59 def quoted_true "1" end |
#unquoted_false ⇒ Object
71 72 73 |
# File 'lib/active_record/connection_adapters/peasys/quoting.rb', line 71 def unquoted_false 0 end |
#unquoted_true ⇒ Object
63 64 65 |
# File 'lib/active_record/connection_adapters/peasys/quoting.rb', line 63 def unquoted_true 1 end |