Class: WinewooCore::Services::Finders::Comments::CurrentWinewooUserCommentsFinder

Inherits:
CommentsFinder
  • Object
show all
Defined in:
lib/winewoo_core/services/finders/comments/current_winewoo_user_comments_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_winewoo_user, filters) ⇒ CurrentWinewooUserCommentsFinder

Returns a new instance of CurrentWinewooUserCommentsFinder.



4
5
6
7
# File 'lib/winewoo_core/services/finders/comments/current_winewoo_user_comments_finder.rb', line 4

def initialize(current_winewoo_user, filters)
  super(filters)
  @current_winewoo_user = current_winewoo_user
end

Instance Method Details

#findObject



10
11
12
13
14
15
# File 'lib/winewoo_core/services/finders/comments/current_winewoo_user_comments_finder.rb', line 10

def find
  return unless @current_winewoo_user
  return @current_winewoo_user.user_comments
    .page(@page || 1)
    .per(@per_page || Kaminari::config.default_per_page)
end