Sha256: 5b668a5e2ed76a37f80e0bfab13fbe8f3f29659d726ec3e38676656e4d01dc74

Contents?: true

Size: 1.08 KB

Versions: 34

Compression:

Stored size: 1.08 KB

Contents

module Workarea
  class Release
    module Status
      class Unscheduled
        include StatusCalculator::Status

        def in_status?
          model.publish_at.blank? &&
          model.published_at.blank? &&
          model.undo_at.blank?
        end
      end

      class Scheduled
        include StatusCalculator::Status

        def in_status?
          return false unless model.publish_at.present?
          model.publish_at >= Time.current
        end
      end

      class Published
        include StatusCalculator::Status

        def in_status?
          model.published_at.present? &&
          model.publish_at.blank?
        end
      end

      class Undone
        include StatusCalculator::Status

        def in_status?
          model.published_at.present? &&
          model.undone_at.present?
        end
      end

      class ScheduledUndo
        include StatusCalculator::Status

        def in_status?
          return false unless model.undo_at.present?
          model.published_at.present? &&
          model.undo_at >= Time.current
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 app/models/workarea/release/status.rb
workarea-core-3.4.44 app/models/workarea/release/status.rb
workarea-core-3.4.43 app/models/workarea/release/status.rb
workarea-core-3.4.42 app/models/workarea/release/status.rb
workarea-core-3.4.41 app/models/workarea/release/status.rb
workarea-core-3.4.40 app/models/workarea/release/status.rb
workarea-core-3.4.39 app/models/workarea/release/status.rb
workarea-core-3.4.38 app/models/workarea/release/status.rb
workarea-core-3.4.37 app/models/workarea/release/status.rb
workarea-core-3.4.36 app/models/workarea/release/status.rb
workarea-core-3.4.35 app/models/workarea/release/status.rb
workarea-core-3.4.34 app/models/workarea/release/status.rb
workarea-core-3.4.33 app/models/workarea/release/status.rb
workarea-core-3.4.32 app/models/workarea/release/status.rb
workarea-core-3.4.31 app/models/workarea/release/status.rb
workarea-core-3.4.30 app/models/workarea/release/status.rb
workarea-core-3.4.29 app/models/workarea/release/status.rb
workarea-core-3.4.28 app/models/workarea/release/status.rb
workarea-core-3.4.27 app/models/workarea/release/status.rb
workarea-core-3.4.26 app/models/workarea/release/status.rb