aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorAbhay Nikam <nikam.abhay1@gmail.com>2019-03-03 19:09:45 +0530
committerAbhay Nikam <nikam.abhay1@gmail.com>2019-03-03 22:25:10 +0530
commit82b0ff03b1d97c29472a65ef15103932d15ff75e (patch)
tree12887d6150b67e1a1fa63d9311412785dc21bff1 /activerecord/test/models
parente33c1f3c26ff3d2921d953d5c747cb5b90c6c1c6 (diff)
downloadrails-82b0ff03b1d97c29472a65ef15103932d15ff75e.tar.gz
rails-82b0ff03b1d97c29472a65ef15103932d15ff75e.tar.bz2
rails-82b0ff03b1d97c29472a65ef15103932d15ff75e.zip
Fixed reselect throwing NoMethodError on ActiveRecord.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/post.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb
index 53cbda83ed..61e5f14100 100644
--- a/activerecord/test/models/post.rb
+++ b/activerecord/test/models/post.rb
@@ -212,6 +212,12 @@ class FirstPost < ActiveRecord::Base
has_one :comment, foreign_key: :post_id
end
+class PostWithDefaultSelect < ActiveRecord::Base
+ self.table_name = "posts"
+
+ default_scope { select(:author_id) }
+end
+
class TaggedPost < Post
has_many :taggings, -> { rewhere(taggable_type: "TaggedPost") }, as: :taggable
has_many :tags, through: :taggings