From 01c85097d4977b0c141b7c89df15c0750f37c62d Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 13 Jul 2017 07:14:59 +0900 Subject: Fix `create_with` using both string and symbol This is related with #27680. Since `where_values_hash` keys constructed by `where` are string, so we need `stringify_keys` to `create_with_value` before merging it. --- activerecord/lib/active_record/associations/collection_association.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'activerecord/lib/active_record/associations/collection_association.rb') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index a49fb155ee..69401162aa 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -374,10 +374,6 @@ module ActiveRecord end end - def create_scope - scope.scope_for_create.stringify_keys - end - def delete_or_destroy(records, method) records = records.flatten records.each { |record| raise_on_type_mismatch!(record) } -- cgit v1.2.3 From 831be98f9a6685da3410b0c9bf4143bd8dd647af Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Sun, 9 Jul 2017 20:41:28 +0300 Subject: Use frozen-string-literal in ActiveRecord --- activerecord/lib/active_record/associations/collection_association.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record/associations/collection_association.rb') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 69401162aa..ed2e6d1ae4 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActiveRecord module Associations # = Active Record Association Collection -- cgit v1.2.3