Module: SolidState

Extended by:
ActiveSupport::Concern
Defined in:
lib/solidstate.rb

Defined Under Namespace

Modules: ClassMethods Classes: InvalidTransitionError

Constant Summary collapse

STATE_ATTRIBUTE =
:state.freeze

Instance Method Summary collapse

Instance Method Details

#set_state(new_state) ⇒ Object



73
74
75
76
# File 'lib/solidstate.rb', line 73

def set_state(new_state)
  return false unless can_transition_to?(new_state)
  self.state = new_state
end