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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjFjNzJjZmMxNTdmMTRiMDAyMTQ4MjZhNGI0ZmU2NTc1ODFhNjIyMA==
4
+ MzExM2E2YzI4ZTg3YmJmYjdiOWQ0YTE1NTgxNmY1ZjA3MGM4NDFkOA==
5
5
  data.tar.gz: !binary |-
6
- ODY3ZTc3Y2VmMmI0ZGNlMzdjYzlkNjhiNGY5YTM2MmFiNDEzN2IxZA==
6
+ NzNkNWRkMThiNDU2OWQwZTZmNDAyM2Y3MjYwYjhlZjRiNThhZjJjYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDMxMjJhMDZiYzA5N2JlN2FiOTBjZDBmN2I2YTA5ODY4YjU5NWIzM2FjM2Q2
10
- YWFjMjZjNGZkMGQwNjE2ODQ1ZWVmOTRiY2MzOWZlN2NhNTk5NTRkZGFmMjg2
11
- NGY3NTZjOWM3M2M1YzI0YzcxZDE5NzQ5MzQ0NTk3Y2IwY2E3YjQ=
9
+ MGE2ODMxNjBiNWE3YTBjYjBjMjViY2ZiNGY3NGQzMGMzYWFjM2MyYmZhZDVh
10
+ Yjg5MzBiNTg3ZmIwZGEzYzJjNTdiMjNlNGEwMGFiNzkzNTEwNGM0MTJkZjUy
11
+ YWYxMDljY2IyODA1YTUyNmQzZmVlNTk0MmRkYjI3YThmODNhZmE=
12
12
  data.tar.gz: !binary |-
13
- NGM5NGIxYzc4MTI4YTNlNWY4YWZlYzU5NWU4ZmU0YzI3MjQyNGE4NGM1NWE5
14
- NzIzYWZmYTk4MmJjMTI1ZjY2MTk5NGI5NmY4YWU4NDlhOGU5OGJlM2Q5ZWM5
15
- ZjNiMWFiODY4MjA4OTMxNzJhY2QxZTdhMjBjOThhMDJhNTU2MTg=
13
+ N2VlNGI4ODhjZWY1NTNhNDI3MjA3NWI5NzliMDdhMTQ5YjUwZWQ0NmU3MTk3
14
+ NzQ5OTBiMDFhNWZhNzQ4ZjIzNDEzY2Q3ZjY5MzZiYTRlZmQwZTkzMDdmNDdl
15
+ ZDVjYmU3YzAxZGEzODllNDM1ZmE2MDZlMjAxMDNjZWI5NzdmZDc=
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ cache:
6
+ bundler: true
7
+ script: bundle exec rspec
data/README.markdown CHANGED
@@ -1,6 +1,9 @@
1
1
  # Purgatory
2
2
 
3
- Purgatory allows you to put changes to an ActiveRecord model into purgatory until they are approved
3
+ [![Build Status](https://secure.travis-ci.org/financeit/purgatory.png)](http://travis-ci.org/financeit/purgatory)
4
+ [![Code Climate](https://codeclimate.com/github/financeit/purgatory.png)](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.12.0
1
+ 2.13.0
@@ -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.12.0 ruby lib
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.12.0"
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-11-29"
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",
@@ -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.12.0
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-29 00:00:00.000000000 Z
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