1
0
Fork 0
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:
Ryuta Kamizono 2017-08-23 11:58:36 +09:00 committed by GitHub
commit abe9592bea

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%'") }