Module: ActiveRecord::ConnectionAdapters::SnowflakeOdbc::Quoting::ClassMethods
- Defined in:
- lib/active_record/connection_adapters/snowflake_odbc/quoting.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#quote_column_name(name) ⇒ Object
Returns a quoted form of the column name.
- #quote_table_name(name) ⇒ Object
Instance Method Details
#quote_column_name(name) ⇒ Object
Returns a quoted form of the column name.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/active_record/connection_adapters/snowflake_odbc/quoting.rb', line 10 def quote_column_name(name) name = name.to_s quote_char = identifier_quote_char.to_s.strip return name if quote_char.empty? quote_char = quote_char[0] # Avoid quoting any already quoted name return name if name[0] == quote_char && name[-1] == quote_char # If upcase identifiers, only quote mixed case names. return name if upcase_identifiers? && name !~ /([A-Z]+[a-z])|([a-z]+[A-Z])/ "#{quote_char.chr}#{name}#{quote_char.chr}" end |
#quote_table_name(name) ⇒ Object
25 26 27 |
# File 'lib/active_record/connection_adapters/snowflake_odbc/quoting.rb', line 25 def quote_table_name(name) name end |