Sha256: 7a9dd9ae65af797e7c77d5df188684a923880fb071a72be0e770551f6c270c83

Contents?: true

Size: 399 Bytes

Versions: 7

Compression:

Stored size: 399 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

7 entries across 7 versions & 1 rubygems

Version Path
acts_as_commentable_more-1.2.5 lib/acts_as_commentable_more/comment_methods.rb
acts_as_commentable_more-1.2.4 lib/acts_as_commentable_more/comment_methods.rb
acts_as_commentable_more-1.2.3 lib/acts_as_commentable_more/comment_methods.rb
acts_as_commentable_more-1.2.2 lib/acts_as_commentable_more/comment_methods.rb
acts_as_commentable_more-1.2.1 lib/acts_as_commentable_more/comment_methods.rb
acts_as_commentable_more-1.2.0 lib/acts_as_commentable_more/comment_methods.rb
acts_as_commentable_more-1.1.0 lib/comment_methods.rb