diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-10 13:08:59 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-10 15:45:46 -0700 |
commit | 268ee64e6362467fc6d2e54df703c620af78f5fb (patch) | |
tree | fe91c42ad411c7d3803cb75e2dbd77dd3cf95efe | |
parent | 0b4fd69b8b2f0f169899978fd260459c16a82030 (diff) | |
download | rails-268ee64e6362467fc6d2e54df703c620af78f5fb.tar.gz rails-268ee64e6362467fc6d2e54df703c620af78f5fb.tar.bz2 rails-268ee64e6362467fc6d2e54df703c620af78f5fb.zip |
Stop passing a column to `quote` when finding by AR models
I'm planning on deprecating the column argument to mirror the
deprecation in [arel].
[arel]: https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11
-rw-r--r-- | activerecord/lib/active_record/sanitization.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb index 768a72a947..313e767dcb 100644 --- a/activerecord/lib/active_record/sanitization.rb +++ b/activerecord/lib/active_record/sanitization.rb @@ -3,14 +3,11 @@ module ActiveRecord extend ActiveSupport::Concern module ClassMethods - def quote_value(value, column) #:nodoc: - connection.quote(value, column) - end - # Used to sanitize objects before they're used in an SQL SELECT statement. Delegates to <tt>connection.quote</tt>. def sanitize(object) #:nodoc: connection.quote(object) end + alias_method :quote_value, :sanitize protected @@ -156,7 +153,7 @@ module ActiveRecord # TODO: Deprecate this def quoted_id - self.class.quote_value(id, column_for_attribute(self.class.primary_key)) + self.class.quote_value(@attributes[self.class.primary_key].value_for_database) end end end |