From f916aa247bddba0c58c50822886bc29e8556df76 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Mon, 29 Dec 2014 11:21:56 -0700 Subject: Remove all cases of manuallly wrapping `Arel::Nodes::Quoted` This is no longer required now that we are injecting a type caster object into the Arel table, with the exception of uniqueness validations. Since it calls `ConnectionAdapter#type_cast`, the value has already been cast for the database. We don't want Arel to attempt to cast it further, so we need to continue wrapping it in a quoted node. This can potentially go away when this validator is refactored to make better use of `where` or the predicate builder. --- activerecord/test/models/author.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 9b740e405a..8c1f14bd36 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -34,7 +34,7 @@ class Author < ActiveRecord::Base -> { where(title: 'Welcome to the weblog').where('comments_count = ?', 1) }, class_name: 'Post' has_many :welcome_posts_with_comments, - -> { where(title: 'Welcome to the weblog').where(Post.arel_table[:comments_count].gt(Arel::Nodes::Quoted.new(0))) }, + -> { where(title: 'Welcome to the weblog').where(Post.arel_table[:comments_count].gt(0)) }, class_name: 'Post' has_many :comments_desc, -> { order('comments.id DESC') }, :through => :posts, :source => :comments -- cgit v1.2.3