From eb921000a11bc87a3b001164fc367b84aee584c5 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sun, 2 Nov 2014 13:34:52 -0700 Subject: 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. --- activerecord/lib/active_record/sanitization.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/lib') 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])}" -- cgit v1.2.3