Sha256: 33a9988e643d7e12d5ddd7940fe614fe63cbb538532c78392c82bfae83fd6480
Contents?: true
Size: 400 Bytes
Versions: 1
Compression:
Stored size: 400 Bytes
Contents
module ActsAsCommentableMore::Finders extend ActiveSupport::Concern def related_attributes read_attribute(:related_attributes).symbolize_keys end module ClassMethods def find_comments_by_user(user, role = nil) attr_finder = { user: user } attr_finder.merge!(role: role.to_s) if role.present? where(attr_finder).order("created_at DESC") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
acts_as_commentable_more-1.0.0 | lib/comment_methods.rb |