README.markdown in purgatory-2.14.0 vs README.markdown in purgatory-3.0.0
- old
+ new
@@ -39,18 +39,27 @@
You can also put the creation of a new object into Purgatory
item = Item.new price: 100
purgatory = item.purgatory!
+Call .purgatize.method(params) to put a method call into Purgatory. When the purgatory is approved the method will be called on the soul
+
+ #without purgatory:
+ item.increase_price(200)
+
+ #with purgatory:
+ item.purgatize(current_user).increase_price(200)
+
The following are some attributes of a purgatory:
purgatory.soul # The ActiveRecord model instance whose changes are in purgatory
purgatory.requester # The user who created the purgatory
purgatory.created_at # The time when the purgatory was created
purgatory.requested_changes # A hash of the proposed changes. The keys are the attribute names and the values are 2-element arrays where the 1st element is the old value and the 2nd element is the new value
purgatory.approver # The user who approved the purgatory
purgatory.approved_at # The time when the purgatory was approved
+ purgatory.performable_method # Information about the method to call on the soul when the purgatory is approved
Here are some handy class and instance methods available to you:
### Class methods
Purgatory.pending # Returns a relation of all pending purgatories
@@ -108,10 +117,18 @@
2. Automatic
use_purgatory :local_attributes => :all
By specifying all, Purgatory will programmatically determine what the virtual attributes are and save them when "purgatory!" is called, so that they will be available during "approve!".
-
+
+## Updating Purgatory Version
+
+ Whenever you update the version of purgatory you will need to:
+
+ 1. Run the generator to create required migrations
+ $ rails generate purgatory
+ 2. Migrate the database
+ $ rake db:migrate
## Contributing to Purgatory
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.