Sha256: 2bd646abd3fc8af20aab2db415b6ef1cbe907a55d342a90f3f7b8cf570bdc7dd
Contents?: true
Size: 748 Bytes
Versions: 9
Compression:
Stored size: 748 Bytes
Contents
module RailsWorkflow module StatusDecorator extend ActiveSupport::Concern included do def status if object.status { class: get_label_class(object), text: object.get_status_values.assoc(object.status)[1] } else { class: nil, text: nil } end end def get_label_class object case object.status when object.class::DONE 'label-success' when object.class::IN_PROGRESS..object.class::WAITING 'label-primary' when object.class::ERROR 'label-danger' else 'label-default' end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems