aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/author.rb
diff options
context:
space:
mode:
authorBen Toews <mastahyeti@gmail.com>2017-09-26 09:29:24 -0600
committerMatthew Draper <matthew@trebex.net>2017-11-09 22:41:33 +1030
commit5180fe2cd8233169935065efe8762bd5d7b2709c (patch)
tree73278df63c9938eb19e2ba1b333e07f70be88b0c /activerecord/test/models/author.rb
parent02a17492a937d4b423590644ad1481b82facd394 (diff)
downloadrails-5180fe2cd8233169935065efe8762bd5d7b2709c.tar.gz
rails-5180fe2cd8233169935065efe8762bd5d7b2709c.tar.bz2
rails-5180fe2cd8233169935065efe8762bd5d7b2709c.zip
allow table name and direction in string order arg
Diffstat (limited to 'activerecord/test/models/author.rb')
-rw-r--r--activerecord/test/models/author.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb
index 11fe073ab0..f462fdb69a 100644
--- a/activerecord/test/models/author.rb
+++ b/activerecord/test/models/author.rb
@@ -8,9 +8,9 @@ class Author < ActiveRecord::Base
has_many :posts_with_comments, -> { includes(:comments) }, class_name: "Post"
has_many :popular_grouped_posts, -> { includes(:comments).group("type").having("SUM(comments_count) > 1").select("type") }, class_name: "Post"
has_many :posts_with_comments_sorted_by_comment_id, -> { includes(:comments).order(Arel.sql("comments.id")) }, class_name: "Post"
- has_many :posts_sorted_by_id_limited, -> { order(Arel.sql("posts.id")).limit(1) }, class_name: "Post"
+ has_many :posts_sorted_by_id_limited, -> { order("posts.id").limit(1) }, class_name: "Post"
has_many :posts_with_categories, -> { includes(:categories) }, class_name: "Post"
- has_many :posts_with_comments_and_categories, -> { includes(:comments, :categories).order(Arel.sql("posts.id")) }, class_name: "Post"
+ has_many :posts_with_comments_and_categories, -> { includes(:comments, :categories).order("posts.id") }, class_name: "Post"
has_many :posts_with_special_categorizations, class_name: "PostWithSpecialCategorization"
has_one :post_about_thinking, -> { where("posts.title like '%thinking%'") }, class_name: "Post"
has_one :post_about_thinking_with_last_comment, -> { where("posts.title like '%thinking%'").includes(:last_comment) }, class_name: "Post"