Skip to content

Commit

Permalink
removed unneeded method (reading the current state for persisted stat…
Browse files Browse the repository at this point in the history
…es is already handled)
  • Loading branch information
alto committed Apr 21, 2013
1 parent 7d43893 commit ede514b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
18 changes: 0 additions & 18 deletions lib/aasm/persistence/active_record_persistence.rb
Expand Up @@ -76,24 +76,6 @@ def with_state_scope(state)

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

# Ensures that if the aasm_state column is nil and the record is new
Expand Down
18 changes: 0 additions & 18 deletions lib/aasm/persistence/mongoid_persistence.rb
Expand Up @@ -70,24 +70,6 @@ def with_state_scope(state)

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

# Ensures that if the aasm_state column is nil and the record is new
Expand Down

0 comments on commit ede514b

Please sign in to comment.