Module: Apollo::ActiveRecordExtensions::InstanceMethods

Defined in:
lib/apollo/active_record_extensions.rb

Instance Method Summary collapse

Instance Method Details

#load_current_stateObject



4
5
6
# File 'lib/apollo/active_record_extensions.rb', line 4

def load_current_state
  read_attribute(self.class.current_state_column)
end

#persist_current_state(new_value) ⇒ Object

On transition the new current state is immediately saved in the database.



10
11
12
# File 'lib/apollo/active_record_extensions.rb', line 10

def persist_current_state(new_value)
  update_attribute self.class.current_state_column, new_value
end