purgatory 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
 - data/.rspec +2 -0
 - data/.travis.yml +7 -0
 - data/README.markdown +4 -1
 - data/VERSION +1 -1
 - data/lib/purgatory/purgatory.rb +1 -1
 - data/purgatory.gemspec +5 -3
 - data/spec/purgatory_spec.rb +20 -0
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                MzExM2E2YzI4ZTg3YmJmYjdiOWQ0YTE1NTgxNmY1ZjA3MGM4NDFkOA==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                NzNkNWRkMThiNDU2OWQwZTZmNDAyM2Y3MjYwYjhlZjRiNThhZjJjYw==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                MGE2ODMxNjBiNWE3YTBjYjBjMjViY2ZiNGY3NGQzMGMzYWFjM2MyYmZhZDVh
         
     | 
| 
      
 10 
     | 
    
         
            +
                Yjg5MzBiNTg3ZmIwZGEzYzJjNTdiMjNlNGEwMGFiNzkzNTEwNGM0MTJkZjUy
         
     | 
| 
      
 11 
     | 
    
         
            +
                YWYxMDljY2IyODA1YTUyNmQzZmVlNTk0MmRkYjI3YThmODNhZmE=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                N2VlNGI4ODhjZWY1NTNhNDI3MjA3NWI5NzliMDdhMTQ5YjUwZWQ0NmU3MTk3
         
     | 
| 
      
 14 
     | 
    
         
            +
                NzQ5OTBiMDFhNWZhNzQ4ZjIzNDEzY2Q3ZjY5MzZiYTRlZmQwZTkzMDdmNDdl
         
     | 
| 
      
 15 
     | 
    
         
            +
                ZDVjYmU3YzAxZGEzODllNDM1ZmE2MDZlMjAxMDNjZWI5NzdmZDc=
         
     | 
    
        data/.rspec
    ADDED
    
    
    
        data/.travis.yml
    ADDED
    
    
    
        data/README.markdown
    CHANGED
    
    | 
         @@ -1,6 +1,9 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Purgatory
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
            [](http://travis-ci.org/financeit/purgatory)
         
     | 
| 
      
 4 
     | 
    
         
            +
            [](https://codeclimate.com/github/financeit/purgatory)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Purgatory is a Rails gem that allows you to save changes to an ActiveRecord model so that they can be applied at a later time.
         
     | 
| 
       4 
7 
     | 
    
         | 
| 
       5 
8 
     | 
    
         
             
            ## How to Use
         
     | 
| 
       6 
9 
     | 
    
         | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            2. 
     | 
| 
      
 1 
     | 
    
         
            +
            2.13.0
         
     | 
    
        data/lib/purgatory/purgatory.rb
    CHANGED
    
    | 
         @@ -55,7 +55,7 @@ class Purgatory < ActiveRecord::Base 
     | 
|
| 
       55 
55 
     | 
    
         
             
              end
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
       57 
57 
     | 
    
         
             
              def self.pending_with_matching_soul(soul)
         
     | 
| 
       58 
     | 
    
         
            -
                pending.where("soul_id IS NOT NULL AND soul_id = ? AND soul_type = ?", soul.id, soul.class.name)
         
     | 
| 
      
 58 
     | 
    
         
            +
                pending.where("soul_id IS NOT NULL AND soul_id = ? AND soul_type = ?", soul.id, soul.class.base_class.name)
         
     | 
| 
       59 
59 
     | 
    
         
             
              end
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
              private
         
     | 
    
        data/purgatory.gemspec
    CHANGED
    
    | 
         @@ -2,15 +2,15 @@ 
     | 
|
| 
       2 
2 
     | 
    
         
             
            # DO NOT EDIT THIS FILE DIRECTLY
         
     | 
| 
       3 
3 
     | 
    
         
             
            # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
         
     | 
| 
       4 
4 
     | 
    
         
             
            # -*- encoding: utf-8 -*-
         
     | 
| 
       5 
     | 
    
         
            -
            # stub: purgatory 2. 
     | 
| 
      
 5 
     | 
    
         
            +
            # stub: purgatory 2.13.0 ruby lib
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.name = "purgatory"
         
     | 
| 
       9 
     | 
    
         
            -
              s.version = "2. 
     | 
| 
      
 9 
     | 
    
         
            +
              s.version = "2.13.0"
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       12 
12 
     | 
    
         
             
              s.authors = ["Elan Dubrofsky"]
         
     | 
| 
       13 
     | 
    
         
            -
              s.date = "2013- 
     | 
| 
      
 13 
     | 
    
         
            +
              s.date = "2013-12-10"
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.description = "Put your model changes in purgatory and allow them to remain lost souls until they are approved"
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.email = "elan.dubrofsky@gmail.com"
         
     | 
| 
       16 
16 
     | 
    
         
             
              s.extra_rdoc_files = [
         
     | 
| 
         @@ -19,6 +19,8 @@ Gem::Specification.new do |s| 
     | 
|
| 
       19 
19 
     | 
    
         
             
              ]
         
     | 
| 
       20 
20 
     | 
    
         
             
              s.files = [
         
     | 
| 
       21 
21 
     | 
    
         
             
                ".document",
         
     | 
| 
      
 22 
     | 
    
         
            +
                ".rspec",
         
     | 
| 
      
 23 
     | 
    
         
            +
                ".travis.yml",
         
     | 
| 
       22 
24 
     | 
    
         
             
                "Gemfile",
         
     | 
| 
       23 
25 
     | 
    
         
             
                "Gemfile.lock",
         
     | 
| 
       24 
26 
     | 
    
         
             
                "LICENSE.txt",
         
     | 
    
        data/spec/purgatory_spec.rb
    CHANGED
    
    | 
         @@ -170,6 +170,18 @@ describe Purgatory do 
     | 
|
| 
       170 
170 
     | 
    
         
             
                      Dog.count.should be_zero
         
     | 
| 
       171 
171 
     | 
    
         
             
                    end
         
     | 
| 
       172 
172 
     | 
    
         
             
                  end
         
     | 
| 
      
 173 
     | 
    
         
            +
             
     | 
| 
      
 174 
     | 
    
         
            +
                  context "create STI object change purgatory" do
         
     | 
| 
      
 175 
     | 
    
         
            +
                    before {create_object_change_purgatory_with_sti}
         
     | 
| 
      
 176 
     | 
    
         
            +
             
     | 
| 
      
 177 
     | 
    
         
            +
                    it "should delete old purgatory on object if new one is created" do
         
     | 
| 
      
 178 
     | 
    
         
            +
                      Purgatory.count.should == 1
         
     | 
| 
      
 179 
     | 
    
         
            +
                      @dog.name = 'fluffy'
         
     | 
| 
      
 180 
     | 
    
         
            +
                      @dog.purgatory!(user1)
         
     | 
| 
      
 181 
     | 
    
         
            +
                      Purgatory.last.requested_changes['name'].last.should == 'fluffy'
         
     | 
| 
      
 182 
     | 
    
         
            +
                      Purgatory.count.should == 1
         
     | 
| 
      
 183 
     | 
    
         
            +
                    end
         
     | 
| 
      
 184 
     | 
    
         
            +
                  end
         
     | 
| 
       173 
185 
     | 
    
         | 
| 
       174 
186 
     | 
    
         
             
                  context "valid object with attr_accessor" do
         
     | 
| 
       175 
187 
     | 
    
         
             
                    before do
         
     | 
| 
         @@ -564,6 +576,14 @@ describe Purgatory do 
     | 
|
| 
       564 
576 
     | 
    
         
             
                purgatory = dog.purgatory! user1
         
     | 
| 
       565 
577 
     | 
    
         
             
                @purgatory = Purgatory.find(purgatory.id)
         
     | 
| 
       566 
578 
     | 
    
         
             
              end
         
     | 
| 
      
 579 
     | 
    
         
            +
             
     | 
| 
      
 580 
     | 
    
         
            +
              def create_object_change_purgatory_with_sti
         
     | 
| 
      
 581 
     | 
    
         
            +
                @dog = Dog.create name: 'doggy'
         
     | 
| 
      
 582 
     | 
    
         
            +
                @dog.name = 'codey'
         
     | 
| 
      
 583 
     | 
    
         
            +
                purgatory = @dog.purgatory! user1
         
     | 
| 
      
 584 
     | 
    
         
            +
                @purgatory = Purgatory.find(purgatory.id)
         
     | 
| 
      
 585 
     | 
    
         
            +
                @dog.reload
         
     | 
| 
      
 586 
     | 
    
         
            +
              end
         
     | 
| 
       567 
587 
     | 
    
         | 
| 
       568 
588 
     | 
    
         
             
              def create_object_change_purgatory_with_attr_accessor
         
     | 
| 
       569 
589 
     | 
    
         
             
                @item = Item.create name: 'foo', price: 100, dante: "classic"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: purgatory
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.13.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Elan Dubrofsky
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2013- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-12-10 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rdoc
         
     | 
| 
         @@ -62,6 +62,8 @@ extra_rdoc_files: 
     | 
|
| 
       62 
62 
     | 
    
         
             
            - README.markdown
         
     | 
| 
       63 
63 
     | 
    
         
             
            files:
         
     | 
| 
       64 
64 
     | 
    
         
             
            - .document
         
     | 
| 
      
 65 
     | 
    
         
            +
            - .rspec
         
     | 
| 
      
 66 
     | 
    
         
            +
            - .travis.yml
         
     | 
| 
       65 
67 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       66 
68 
     | 
    
         
             
            - Gemfile.lock
         
     | 
| 
       67 
69 
     | 
    
         
             
            - LICENSE.txt
         
     |