mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
removed unneeded method (reading the current state for persisted states is already handled)
This commit is contained in:
parent
7d43893bbf
commit
ede514b115
2 changed files with 0 additions and 36 deletions
|
@ -76,24 +76,6 @@ module AASM
|
||||||
|
|
||||||
module InstanceMethods
|
module InstanceMethods
|
||||||
|
|
||||||
# Returns the current aasm_state of the object. Respects reload and
|
|
||||||
# any changes made to the aasm_state field directly
|
|
||||||
#
|
|
||||||
# Internally just calls <tt>aasm_read_state</tt>
|
|
||||||
#
|
|
||||||
# foo = Foo.find(1)
|
|
||||||
# foo.aasm_current_state # => :pending
|
|
||||||
# foo.aasm_state = "opened"
|
|
||||||
# foo.aasm_current_state # => :opened
|
|
||||||
# foo.close # => calls aasm_write_state_without_persistence
|
|
||||||
# foo.aasm_current_state # => :closed
|
|
||||||
# foo.reload
|
|
||||||
# foo.aasm_current_state # => :pending
|
|
||||||
#
|
|
||||||
def aasm_current_state
|
|
||||||
@current_state = aasm_read_state
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Ensures that if the aasm_state column is nil and the record is new
|
# Ensures that if the aasm_state column is nil and the record is new
|
||||||
|
|
|
@ -70,24 +70,6 @@ module AASM
|
||||||
|
|
||||||
module InstanceMethods
|
module InstanceMethods
|
||||||
|
|
||||||
# Returns the current aasm_state of the object. Respects reload and
|
|
||||||
# any changes made to the aasm_state field directly
|
|
||||||
#
|
|
||||||
# Internally just calls <tt>aasm_read_state</tt>
|
|
||||||
#
|
|
||||||
# foo = Foo.find(1)
|
|
||||||
# foo.aasm_current_state # => :pending
|
|
||||||
# foo.aasm_state = "opened"
|
|
||||||
# foo.aasm_current_state # => :opened
|
|
||||||
# foo.close # => calls aasm_write_state_without_persistence
|
|
||||||
# foo.aasm_current_state # => :closed
|
|
||||||
# foo.reload
|
|
||||||
# foo.aasm_current_state # => :pending
|
|
||||||
#
|
|
||||||
def aasm_current_state
|
|
||||||
@current_state = aasm_read_state
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Ensures that if the aasm_state column is nil and the record is new
|
# Ensures that if the aasm_state column is nil and the record is new
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue