instance method
quote
Ruby on Rails 4.2.9
Since v2.2.3Signature
quote(value, column = nil)
Quotes the column value to help prevent SQL injection attacks.
Parameters
-
valuereq -
columnopt = nil
Source
# File activerecord/lib/active_record/connection_adapters/abstract/quoting.rb, line 9
def quote(value, column = nil)
# records are quoted as their primary key
return value.quoted_id if value.respond_to?(:quoted_id)
if column
value = column.cast_type.type_cast_for_database(value)
end
_quote(value)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/quoting.rb line 9
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Quoting