1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

counter_cache requires association class before attr_readonly

There were similar pull requests #26370 #27575 fixed by different way
by moving `require "models/post"` before `require "models/comment"`
This commit is contained in:
Yasuo Honda 2017-08-22 18:09:56 +00:00
parent 665ac7cff2
commit aaaa2dc04a

View file

@ -1,5 +1,8 @@
# frozen_string_literal: true
# `counter_cache` requires association class before `attr_readonly`.
class Post < ActiveRecord::Base; end
class Comment < ActiveRecord::Base
scope :limit_by, lambda { |l| limit(l) }
scope :containing_the_letter_e, -> { where("comments.body LIKE '%e%'") }