mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #30365 from yahonda/require_post_before_comment
`counter_cache` requires association class before `attr_readonly`
This commit is contained in:
commit
abe9592bea
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