Class: RailsWorkflow::OperationHelperDecorator

Inherits:
Decorator
  • Object
show all
Includes:
StatusDecorator
Defined in:
app/decorators/rails_workflow/operation_helper_decorator.rb

Direct Known Subclasses

OperationDecorator

Instance Method Summary collapse

Methods inherited from Decorator

collection_decorator_class

Instance Method Details

#assigned_toObject



8
9
10
11
12
13
14
# File 'app/decorators/rails_workflow/operation_helper_decorator.rb', line 8

def assigned_to
  object.assignment.try(:email) || begin
    [
      assignment_by_role, assignment_by_group
    ].compact.join(', ')
  end
end

#assignment_by_groupObject



20
21
22
# File 'app/decorators/rails_workflow/operation_helper_decorator.rb', line 20

def assignment_by_group
  ::User.group_text(object.group) if object.group
end

#assignment_by_roleObject



16
17
18
# File 'app/decorators/rails_workflow/operation_helper_decorator.rb', line 16

def assignment_by_role
  ::User.role_text(object.role) if object.role
end

#completed_atObject



28
29
30
31
32
# File 'app/decorators/rails_workflow/operation_helper_decorator.rb', line 28

def completed_at
  if object.completed_at.present?
    object.completed_at.strftime('%m/%d/%Y %H:%M')
  end
end

#created_atObject



24
25
26
# File 'app/decorators/rails_workflow/operation_helper_decorator.rb', line 24

def created_at
  object.created_at.strftime('%m/%d/%Y %H:%M')
end