From ede514b11577d486460ce71ceb98ad0ba38e9af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Bo=CC=88ttger?= Date: Sun, 21 Apr 2013 18:28:17 +0200 Subject: [PATCH] removed unneeded method (reading the current state for persisted states is already handled) --- .../persistence/active_record_persistence.rb | 18 ------------------ lib/aasm/persistence/mongoid_persistence.rb | 18 ------------------ 2 files changed, 36 deletions(-) diff --git a/lib/aasm/persistence/active_record_persistence.rb b/lib/aasm/persistence/active_record_persistence.rb index 31ca9f1..b2c70d9 100644 --- a/lib/aasm/persistence/active_record_persistence.rb +++ b/lib/aasm/persistence/active_record_persistence.rb @@ -76,24 +76,6 @@ module AASM 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 aasm_read_state - # - # 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 diff --git a/lib/aasm/persistence/mongoid_persistence.rb b/lib/aasm/persistence/mongoid_persistence.rb index ea0407c..e1eda1c 100644 --- a/lib/aasm/persistence/mongoid_persistence.rb +++ b/lib/aasm/persistence/mongoid_persistence.rb @@ -70,24 +70,6 @@ module AASM 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 aasm_read_state - # - # 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