method
quote_string
v2.2.1 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
quote_string(s)public
Quotes strings for use in SQL input in the postgres driver for better performance.
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 374
def quote_string(s) #:nodoc:
if PGconn.respond_to?(:escape)
self.class.instance_eval do
define_method(:quote_string) do |s|
PGconn.escape(s)
end
end
else
# There are some incorrectly compiled postgres drivers out there
# that don't define PGconn.escape.
self.class.instance_eval do
remove_method(:quote_string)
end
end
quote_string(s)
end Related methods
- Instance methods
- active?
- adapter_name
- add_column
- add_order_by_for_association_limiting!
- begin_db_transaction
- change_column
- change_column_default
- change_column_null
- client_min_messages
- client_min_messages=
- columns
- commit_db_transaction
- create_database
- current_database
- default_sequence_name
- disable_referential_integrity
- disconnect!
- distinct
- drop_database
- encoding
- escape_bytea
- execute
- indexes
- insert
- native_database_types
- pk_and_sequence_for
- query
- quote
- quote_column_name
- quote_string
- quoted_date
- reconnect!
- recreate_database
- remove_index
- rename_column
- rename_table
- reset_pk_sequence!
- result_as_array
- rollback_db_transaction
- schema_search_path
- schema_search_path=
- select_rows
- supports_ddl_transactions?
- supports_disable_referential_integrity?
- supports_insert_with_returning?
- supports_migrations?
- supports_standard_conforming_strings?
- table_alias_length
- tables
- transaction
- transaction_active?
- type_to_sql
- unescape_bytea
- update_sql
- Class methods
- new
- Protected methods
-
postgresql_version - Private methods
-
column_definitions -
configure_connection -
connect -
last_insert_id -
select -
select_raw