Class: WinewooCore::Services::Finders::Comments::WineCommentsFinder
- Inherits:
-
CommentsFinder
- Object
- CommentsFinder
- WinewooCore::Services::Finders::Comments::WineCommentsFinder
- Defined in:
- lib/winewoo_core/services/finders/comments/wine_comments_finder.rb
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(wine_id, filters) ⇒ WineCommentsFinder
constructor
A new instance of WineCommentsFinder.
Constructor Details
#initialize(wine_id, filters) ⇒ WineCommentsFinder
Returns a new instance of WineCommentsFinder.
4 5 6 7 |
# File 'lib/winewoo_core/services/finders/comments/wine_comments_finder.rb', line 4 def initialize(wine_id, filters) super(filters) @wine_id = wine_id end |
Instance Method Details
#find ⇒ Object
10 11 12 13 14 |
# File 'lib/winewoo_core/services/finders/comments/wine_comments_finder.rb', line 10 def find return unless @wine_id wine = Wine.find(@wine_id) return wine.vintages.map(&:user_comments).flatten if wine end |