permanent_records 3.1.5 → 3.1.6

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbc6799c008b20acbe6351deae51a3eaa70de70a
4
- data.tar.gz: adf027e92fb79ee117fe6e4289ee2805d759b85c
3
+ metadata.gz: 78b0fb28d98b7b5a68bb591b23eaded91bba6f87
4
+ data.tar.gz: 756981d277d14d61780c49250f6c9893e01f6a6b
5
5
  SHA512:
6
- metadata.gz: c0108fd51f2a6c7e7644ce4ad1b1d6685e3b1771139ca199b0955349d1d6d7d379056e5ac68ffda99c38e8604c034e182ae2f071ab366391fb5dd2ef0b444338
7
- data.tar.gz: 78b4d76a19c70ccf8c63da15d51aa20b024f40030b296732c3cb6184fbf5b472394290bda64eaf059e3947ff0ac704ca49b9b17869e378f71b7367f20e5d8ab5
6
+ metadata.gz: 915ccc96b2ad16475d21349ac09649227816947f66044eaf023a0dec6f561887cd5fb3295dcd73f979a61ae964239c3ff96336c3bfed58086e0deeb148233134
7
+ data.tar.gz: 7e2723e413ceb80205bfa2256d50ff26383efa77db256f6013c3c7e40c34a1b2cda204ea0d0e363cbd9635513c4d84e474a5ac9622b8c3059f9ad81f79cd21a3
data/Gemfile CHANGED
@@ -3,11 +3,14 @@ source 'https://rubygems.org'
3
3
  ver = ENV['AR_TEST_VERSION']
4
4
  ver = ver.dup.chomp if ver
5
5
 
6
- gem 'pg'
7
6
  gem 'activerecord', ver
8
7
  gem 'activesupport', ver
9
- gem 'rake'
10
8
 
11
- gem 'awesome_print'
12
- gem 'database_cleaner'
13
- gem 'rspec'
9
+ group :test do
10
+ gem 'rake'
11
+ gem 'pg'
12
+ gem 'pry'
13
+ gem 'awesome_print'
14
+ gem 'database_cleaner'
15
+ gem 'rspec'
16
+ end
data/README.markdown CHANGED
@@ -5,7 +5,7 @@
5
5
  This gem prevents any of your ActiveRecord data from being destroyed.
6
6
  Any model that you've given a "deleted_at" datetime column will have that column set rather than let the record be deleted.
7
7
 
8
- ## Compatibility: This gem is for Rails 3.x
8
+ ## Compatibility: This gem is for Rails 3+
9
9
 
10
10
  ## Does it make a lot of sense?
11
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.5
1
+ 3.1.6
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
23
23
  ".document",
24
24
  "Gemfile",
25
25
  "LICENSE",
26
- "MIT-LICENSE",
27
26
  "README.markdown",
28
27
  "Rakefile",
29
28
  "VERSION",
@@ -120,11 +120,18 @@ describe PermanentRecords do
120
120
  end
121
121
  end
122
122
  context 'as default scope' do
123
+ let(:load_comments) { Comment.unscoped.find_all_by_hole_id(subject.id) }
123
124
  context 'with :has_many cardinality' do
124
- its('comments.size') { should == 2 }
125
+ before {
126
+ load_comments.size.should == 2
127
+ }
125
128
  it 'deletes them' do
126
- subject.comments.each {|c| c.should be_deleted }
127
- subject.comments.each {|c| Comment.find_by_id(c.id).should be_nil }
129
+ load_comments.all?(&:deleted?).should be_true
130
+ # Doesn't change the default scope
131
+ # (in versions with non-broken default scope)
132
+ if ActiveRecord::VERSION::STRING > '3.0.0'
133
+ subject.comments.should be_blank
134
+ end
128
135
  end
129
136
  end
130
137
  context 'with :has_one cardinality' do
@@ -1,11 +1,5 @@
1
1
  class Comment < ActiveRecord::Base
2
2
  belongs_to :hole
3
3
 
4
- if ActiveRecord::VERSION::MAJOR >= 3
5
- default_scope where(:deleted_at => nil)
6
- else
7
- def self.unscoped
8
- self
9
- end
10
- end
11
- end
4
+ default_scope where(:deleted_at => nil)
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: permanent_records
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.5
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-08-08 00:00:00.000000000 Z
14
+ date: 2013-08-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activerecord
@@ -53,7 +53,6 @@ files:
53
53
  - .document
54
54
  - Gemfile
55
55
  - LICENSE
56
- - MIT-LICENSE
57
56
  - README.markdown
58
57
  - Rakefile
59
58
  - VERSION
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2008 [name of plugin creator]
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.