aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-11-02 13:34:52 -0700
committerSean Griffin <sean@thoughtbot.com>2014-11-02 13:34:52 -0700
commiteb921000a11bc87a3b001164fc367b84aee584c5 (patch)
treea0ab73397535d0200e3b877c7851b4cd25d0ac12 /activerecord/lib/active_record
parentd3fbd9dbb8f3c215c5364c07e32b5bc1d2497633 (diff)
downloadrails-eb921000a11bc87a3b001164fc367b84aee584c5.tar.gz
rails-eb921000a11bc87a3b001164fc367b84aee584c5.tar.bz2
rails-eb921000a11bc87a3b001164fc367b84aee584c5.zip
Deprecate `sanitize_sql_hash_` methods on ActiveRecord
These appear to be implementation relics of times past. They duplicate the logic in Relation, and are no longer used internally.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/sanitization.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb
index 2c5cf944a4..d80b516c67 100644
--- a/activerecord/lib/active_record/sanitization.rb
+++ b/activerecord/lib/active_record/sanitization.rb
@@ -87,6 +87,9 @@ module ActiveRecord
# { address: Address.new("123 abc st.", "chicago") }
# # => "address_street='123 abc st.' and address_city='chicago'"
def sanitize_sql_hash_for_conditions(attrs, default_table_name = self.table_name)
+ ActiveSupport::Deprecation.warn(<<-EOWARN)
+sanitize_sql_hash_for_conditions is deprecated, and will be removed in Rails 5.0
+ EOWARN
attrs = PredicateBuilder.resolve_column_aliases self, attrs
attrs = expand_hash_conditions_for_aggregates(attrs)
@@ -101,6 +104,9 @@ module ActiveRecord
# { status: nil, group_id: 1 }
# # => "status = NULL , group_id = 1"
def sanitize_sql_hash_for_assignment(attrs, table)
+ ActiveSupport::Deprecation.warn(<<-EOWARN)
+sanitize_sql_hash_for_assignment is deprecated, and will be removed in Rails 5.0
+ EOWARN
c = connection
attrs.map do |attr, value|
"#{c.quote_table_name_for_assignment(table, attr)} = #{quote_bound_value(value, c, columns_hash[attr.to_s])}"