aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-14 04:34:00 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-02-14 05:22:41 +0900
commit4f2a635661077fd5c3097e2a4c1496760600132a (patch)
treeacd84fbe7e45d78d7f510fc6e721bd410f3e8db5 /activerecord/test/models
parent4e4b1d05ea820ff777e4734596bb6b0d85495c42 (diff)
downloadrails-4f2a635661077fd5c3097e2a4c1496760600132a.tar.gz
rails-4f2a635661077fd5c3097e2a4c1496760600132a.tar.bz2
rails-4f2a635661077fd5c3097e2a4c1496760600132a.zip
Revert "Chaining named scope is no longer leaking to class level querying methods"
This reverts #32380, since this may cause that silently leaking information when people upgrade the app. We need deprecation first before making this.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/reply.rb2
-rw-r--r--activerecord/test/models/topic.rb3
2 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/test/models/reply.rb b/activerecord/test/models/reply.rb
index 0807bcf875..b35623a344 100644
--- a/activerecord/test/models/reply.rb
+++ b/activerecord/test/models/reply.rb
@@ -7,6 +7,8 @@ class Reply < Topic
belongs_to :topic_with_primary_key, class_name: "Topic", primary_key: "title", foreign_key: "parent_title", counter_cache: "replies_count", touch: true
has_many :replies, class_name: "SillyReply", dependent: :destroy, foreign_key: "parent_id"
has_many :silly_unique_replies, dependent: :destroy, foreign_key: "parent_id"
+
+ scope :ordered, -> { Reply.order(:id) }
end
class SillyReply < Topic
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index fdb461ed7f..75890c327a 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -10,9 +10,6 @@ class Topic < ActiveRecord::Base
scope :approved, -> { where(approved: true) }
scope :rejected, -> { where(approved: false) }
- scope :children, -> { where.not(parent_id: nil) }
- scope :has_children, -> { where(id: Topic.children.select(:parent_id)) }
-
scope :scope_with_lambda, lambda { all }
scope :by_lifo, -> { where(author_name: "lifo") }