Sha256: 2b60feebf5777c9c1954778e546998dcb22f4585ab0c10d67b1c7fa5e6b8539a

Contents?: true

Size: 525 Bytes

Versions: 20

Compression:

Stored size: 525 Bytes

Contents

module Ddr
  module Managers
    class WorkflowManager < Manager

      PUBLISHED = "published"
      UNPUBLISHED = "unpublished"

      def published?
        object.workflow_state == PUBLISHED
      end
      
      def publish
        object.workflow_state = PUBLISHED
      end

      def publish!
        publish
        object.save
      end
      
      def unpublish
        object.workflow_state = UNPUBLISHED
      end

      def unpublish!
        unpublish
        object.save
      end

    end
  end
end
      

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-1.13.2 lib/ddr/managers/workflow_manager.rb
ddr-models-1.13.1 lib/ddr/managers/workflow_manager.rb
ddr-models-1.13.0 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.8 lib/ddr/managers/workflow_manager.rb
ddr-models-1.12.3 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.7 lib/ddr/managers/workflow_manager.rb
ddr-models-1.12.2 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.6 lib/ddr/managers/workflow_manager.rb
ddr-models-1.12.1 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.5 lib/ddr/managers/workflow_manager.rb
ddr-models-1.12.0 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.4 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.3 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.2 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.1 lib/ddr/managers/workflow_manager.rb
ddr-models-1.11.0 lib/ddr/managers/workflow_manager.rb
ddr-models-1.10.0 lib/ddr/managers/workflow_manager.rb
ddr-models-1.9.0 lib/ddr/managers/workflow_manager.rb
ddr-models-1.8.1 lib/ddr/managers/workflow_manager.rb
ddr-models-1.8.0 lib/ddr/managers/workflow_manager.rb