aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/where_clause.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-07-13 07:14:59 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-07-16 15:38:49 +0900
commit01c85097d4977b0c141b7c89df15c0750f37c62d (patch)
tree301350f925e10f533c75923585a0f84d99828897 /activerecord/lib/active_record/relation/where_clause.rb
parent189b8a06dc703f7a8477f877f0a02e23dd691ed8 (diff)
downloadrails-01c85097d4977b0c141b7c89df15c0750f37c62d.tar.gz
rails-01c85097d4977b0c141b7c89df15c0750f37c62d.tar.bz2
rails-01c85097d4977b0c141b7c89df15c0750f37c62d.zip
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.
Diffstat (limited to 'activerecord/lib/active_record/relation/where_clause.rb')
-rw-r--r--activerecord/lib/active_record/relation/where_clause.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/where_clause.rb b/activerecord/lib/active_record/relation/where_clause.rb
index 119910ee79..0feb2c6cb2 100644
--- a/activerecord/lib/active_record/relation/where_clause.rb
+++ b/activerecord/lib/active_record/relation/where_clause.rb
@@ -52,8 +52,8 @@ module ActiveRecord
binds = self.binds.map { |attr| [attr.name, attr.value] }.to_h
equalities.map { |node|
- name = node.left.name
- [name, binds.fetch(name.to_s) {
+ name = node.left.name.to_s
+ [name, binds.fetch(name) {
case node.right
when Array then node.right.map(&:val)
when Arel::Nodes::Casted, Arel::Nodes::Quoted