9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/winewoo_core/use_cases/winewoo_user/comments/create_comment.rb', line 9
def call(winewoo_user, wine_id, vintage_id, , enable_indexation)
= self.repo.create(winewoo_user, wine_id, vintage_id, )
if
if .persisted?
log = self.log_repo.create(complete_log_params())
WinewooCore.feed_repo.new.create(log) if enable_indexation
end
yield .persisted? ?
UseCaseResults.success() :
UseCaseResults.failure(.errors)
else
yield UseCaseResults.not_found
end
end
|