purgatory 3.1.1 → 3.1.2
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/VERSION +2 -1
- data/lib/purgatory/purgatory.rb +14 -12
- data/purgatory.gemspec +3 -3
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                YmZmZDQ1M2NjYTQ3YTU4MGY1YjdjNWY4ZjNlNGVjM2QyYjIxNDE4Mw==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                YmI2MzNkNmUyZmVjNGVhNTJiYTEzMTMwM2YyOWU3ZmNkNzg0NWMyYw==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                NTEyYTBhMTBkMzc1ODhmYTNjOTFmMjkzMDMwOWI0MzZiZDcxM2JhOTFiNGM2
         | 
| 10 | 
            +
                MGRhZmY3ZWY1MjUyNTdjYTY2MWNlZTkwZjJiMmNiNGFhNDIyNjVjM2NmYTlj
         | 
| 11 | 
            +
                MWMxM2Q2ZmZmM2U4OTRlZmNkYjdhMWZjOTRlNTk4MmYyNmE5NjU=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                ZTA0NDY5NDliOTFjMTcyMzcyZGRkOGViZGI5ZWUwZTVkNzM4MjliZjUxMzU2
         | 
| 14 | 
            +
                NTNjYTMwMDM0MmRjODZjYzdiNzc0YmVlYzMwYzg2MDY4YTMyZmRkMDViMDBk
         | 
| 15 | 
            +
                ZDYzNmFiMjBkMTg4MjU1MDMzNzhlNzFiNmZiNTg5MTViMjdiMWM=
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1,2 @@ | |
| 1 | 
            -
            3.1. | 
| 1 | 
            +
            3.1.2
         | 
| 2 | 
            +
             | 
    
        data/lib/purgatory/purgatory.rb
    CHANGED
    
    | @@ -44,20 +44,22 @@ class Purgatory < ActiveRecord::Base | |
| 44 44 | 
             
              end
         | 
| 45 45 |  | 
| 46 46 | 
             
              def approve!(approver = nil)
         | 
| 47 | 
            -
                 | 
| 48 | 
            -
             | 
| 49 | 
            -
             | 
| 50 | 
            -
                   | 
| 51 | 
            -
             | 
| 47 | 
            +
                self.with_lock do
         | 
| 48 | 
            +
                  return false if approved?
         | 
| 49 | 
            +
                  success = soul_with_changes.save
         | 
| 50 | 
            +
                  if performable_method.present? && success
         | 
| 51 | 
            +
                    success = soul.send(performable_method[:method],*performable_method[:args])
         | 
| 52 | 
            +
                  end
         | 
| 52 53 |  | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 54 | 
            +
                  if success
         | 
| 55 | 
            +
                    self.approver = approver
         | 
| 56 | 
            +
                    self.approved_at = Time.now
         | 
| 57 | 
            +
                    self.soul_id = soul.id
         | 
| 58 | 
            +
                    save
         | 
| 59 | 
            +
                    return true
         | 
| 60 | 
            +
                  end
         | 
| 61 | 
            +
                  false
         | 
| 59 62 | 
             
                end
         | 
| 60 | 
            -
                false
         | 
| 61 63 | 
             
              end
         | 
| 62 64 |  | 
| 63 65 | 
             
              def self.pending_with_matching_soul(soul)
         | 
    
        data/purgatory.gemspec
    CHANGED
    
    | @@ -2,16 +2,16 @@ | |
| 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 3.1. | 
| 5 | 
            +
            # stub: purgatory 3.1.2 ruby lib
         | 
| 6 6 |  | 
| 7 7 | 
             
            Gem::Specification.new do |s|
         | 
| 8 8 | 
             
              s.name = "purgatory"
         | 
| 9 | 
            -
              s.version = "3.1. | 
| 9 | 
            +
              s.version = "3.1.2"
         | 
| 10 10 |  | 
| 11 11 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 12 12 | 
             
              s.require_paths = ["lib"]
         | 
| 13 13 | 
             
              s.authors = ["Elan Dubrofsky"]
         | 
| 14 | 
            -
              s.date = "2017-08- | 
| 14 | 
            +
              s.date = "2017-08-24"
         | 
| 15 15 | 
             
              s.description = "Put your model changes in purgatory and allow them to remain lost souls until they are approved"
         | 
| 16 16 | 
             
              s.email = "elan.dubrofsky@gmail.com"
         | 
| 17 17 | 
             
              s.extra_rdoc_files = [
         | 
    
        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: 3.1. | 
| 4 | 
            +
              version: 3.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Elan Dubrofsky
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2017-08- | 
| 11 | 
            +
            date: 2017-08-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rdoc
         |