Class: Collavre::Comments::WorkCommand

Inherits:
Object
  • Object
show all
Includes:
Concerns::WorkflowSupport
Defined in:
app/services/collavre/comments/work_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(comment:, user:) ⇒ WorkCommand

Returns a new instance of WorkCommand.



6
7
8
9
10
# File 'app/services/collavre/comments/work_command.rb', line 6

def initialize(comment:, user:)
  @comment = comment
  @user = user
  @creative = comment.creative.effective_origin
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
# File 'app/services/collavre/comments/work_command.rb', line 12

def call
  return unless work_command?
  execute_work
rescue StandardError => e
  Rails.logger.error("Work command failed: #{e.message}")
  e.message
end