instance method
quote
Ruby on Rails 6.1.7.10
Since v2.2.3Signature
quote(value)
Quotes the column value to help prevent SQL injection attacks.
Parameters
-
valuereq
Source
# File activerecord/lib/active_record/connection_adapters/abstract/quoting.rb, line 11
def quote(value)
if value.is_a?(Base)
ActiveSupport::Deprecation.warn(<<~MSG)
Passing an Active Record object to `quote` directly is deprecated
and will be no longer quoted as id value in Rails 7.0.
MSG
value = value.id_for_database
end
_quote(value)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/quoting.rb line 11
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Quoting