Class: RailsWorkflow::OperationHelperDecorator
Instance Method Summary
collapse
Methods inherited from Decorator
collection_decorator_class
Instance Method Details
#assigned_to ⇒ Object
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_group ⇒ Object
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_role ⇒ Object
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_at ⇒ Object
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_at ⇒ Object
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
|