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:
parent
665ac7cff2
commit
aaaa2dc04a
1 changed files with 3 additions and 0 deletions
|
@ -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%'") }
|
||||
|
|
Loading…
Reference in a new issue