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



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

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

end

#completed_atObject



21
22
23
24
25
# File 'app/decorators/rails_workflow/operation_helper_decorator.rb', line 21

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

#created_atObject



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

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