Sha256: 8ea33570fd04e7e3874cd0a76420cf44c77937636c1693b2799038174ffa65a9
Contents?: true
Size: 425 Bytes
Versions: 6
Compression:
Stored size: 425 Bytes
Contents
module ActsAsCommentableMore module Helpers module Post module ScopesHelper def define_all_comments_scope comment_name, commentable redefine_method("all_#{comment_name.to_s}") do comment_model .includes(commentable.to_sym, :user) .where(commentable.to_sym => self) .order(created_at: :desc) end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems