Sha256: 7a48d0d07366ff9b36e358a0510bbb60c8f88fa11e15f0f4154336af7df6f4f7

Contents?: true

Size: 437 Bytes

Versions: 32

Compression:

Stored size: 437 Bytes

Contents

class Pulitzer::PostTypeVersion::Retire
  include StateMachine::Transition

  self.action_name = :retire
  self.target_state = 'retired'
  self.valid_from_states = [:published]

  def initialize(post_type_version)
    @post_type_version = post_type_version
    self.object = @post_type_version
    self.errors = ActiveModel::Errors.new(self)
  end

  def retire
    self.validate_transition!
    update_status
    return true
  end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
pulitzer-0.15.31 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.30 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.29 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.28 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.27 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.26 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.25 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.24 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.23 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.22 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.21 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.20 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.19 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.18 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.17 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.16 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.15 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.14 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.13 app/services/pulitzer/post_type_version/retire.rb
pulitzer-0.15.12 app/services/pulitzer/post_type_version/retire.rb