Sha256: d0a43fd45fc896479fa5eb0c18c39531ffe602aef80820e12d868f1989d7a7e0

Contents?: true

Size: 579 Bytes

Versions: 10

Compression:

Stored size: 579 Bytes

Contents

module RailsWorkflow
  class OperationHelperDecorator < Decorator

    include StatusDecorator
    delegate :id, :title, :instruction, :complete

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

    end

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

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

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails_workflow-0.3.7 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.3.6 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.3.5 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.3.4 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.3.3 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.3.2 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.3.1 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.3.0 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.2.2 app/decorators/rails_workflow/operation_helper_decorator.rb
rails_workflow-0.2.1 app/decorators/rails_workflow/operation_helper_decorator.rb