diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-12-26 17:50:20 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-26 17:50:20 -0700 |
commit | de0cfd27a54545131d3ae756eb725a91ab4f0907 (patch) | |
tree | ce25c5edf649affde16a660fb9cb40b72968fc08 /activerecord/test/models | |
parent | 108df8cc90fc32ca08ff1cc86bc79ceb03ee1bfc (diff) | |
download | rails-de0cfd27a54545131d3ae756eb725a91ab4f0907.tar.gz rails-de0cfd27a54545131d3ae756eb725a91ab4f0907.tar.bz2 rails-de0cfd27a54545131d3ae756eb725a91ab4f0907.zip |
Inform Arel we don't need additional type casting in tests
Part of the larger refactoring to remove type casting from Arel. We can
inform it that we already have the right type by wrapping the value in
an `Arel::Nodes::Quoted`. This commit can be reverted when we have
removed type casting from Arel in Rail 5.1
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/author.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 8c1f14bd36..9b740e405a 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(0)) }, + -> { where(title: 'Welcome to the weblog').where(Post.arel_table[:comments_count].gt(Arel::Nodes::Quoted.new(0))) }, class_name: 'Post' has_many :comments_desc, -> { order('comments.id DESC') }, :through => :posts, :source => :comments |