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



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

def assigned_to
  object.assignment.try(:email) || begin
    [
      ::User.role_text(object.role),
      ::User.group_text(object.group)
    ].compact.join(', ')
  end
end

#completed_atObject



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

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

#created_atObject



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

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