Module: Torque::PostgreSQL::Adapter::Quoting
- Included in:
- Torque::PostgreSQL::Adapter
- Defined in:
- lib/torque/postgresql/adapter/quoting.rb
Constant Summary collapse
- Name =
ActiveRecord::ConnectionAdapters::PostgreSQL::Name
Instance Method Summary collapse
-
#quote_type_name(string, schema = nil) ⇒ Object
Quotes type names for use in SQL queries.
Instance Method Details
#quote_type_name(string, schema = nil) ⇒ Object
Quotes type names for use in SQL queries.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/torque/postgresql/adapter/quoting.rb', line 9 def quote_type_name(string, schema = nil) name_schema, table = string.to_s.scan(/[^".\s]+|"[^"]*"/) if table.nil? table = name_schema name_schema = nil end schema = schema || name_schema || 'public' Name.new(schema, table).quoted end |