delete_paranoid 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CONTRIBUTORS.txt +6 -0
- data/LICENSE.txt +19 -17
- data/README.md +45 -0
- data/delete_paranoid.gemspec +2 -2
- data/lib/delete_paranoid/version.rb +1 -1
- metadata +80 -118
- data/README.rdoc +0 -43
data/CONTRIBUTORS.txt
ADDED
data/LICENSE.txt
CHANGED
@@ -1,20 +1,22 @@
|
|
1
|
-
|
1
|
+
The MIT License
|
2
2
|
|
3
|
-
|
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:
|
3
|
+
Copyright (c) 2011 Socialcast, Inc
|
10
4
|
|
11
|
-
|
12
|
-
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
13
22
|
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# delete_paranoid
|
2
|
+
|
3
|
+
Soft Delete ActiveRecord instances.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
class Blog < ActiveRecord::Base
|
9
|
+
acts_as_paranoid
|
10
|
+
end
|
11
|
+
blog = Blog.create! :name => 'foo'
|
12
|
+
|
13
|
+
# soft delete the instance
|
14
|
+
blog.destroy
|
15
|
+
|
16
|
+
# query database for results *including* soft deleted objects
|
17
|
+
Blog.with_deleted do
|
18
|
+
Blog.all
|
19
|
+
end
|
20
|
+
|
21
|
+
# permenantly delete the instance from the database
|
22
|
+
Blog.delete! blog.id
|
23
|
+
```
|
24
|
+
|
25
|
+
## Features
|
26
|
+
* simple configuration
|
27
|
+
* preserves existing ActiveRecord API. No magical new API's to use when you want to soft delete a record
|
28
|
+
* automatically exclude soft deleted records from database queries (by default)
|
29
|
+
* support for querying database for all records (including soft deleted ones)
|
30
|
+
* support for permenantly deleting record from database
|
31
|
+
|
32
|
+
## Contributing
|
33
|
+
|
34
|
+
* Fork the project
|
35
|
+
* Fix the issue
|
36
|
+
* Add tests
|
37
|
+
* Submit a pull request on github
|
38
|
+
|
39
|
+
see CONTRIBUTORS.txt for complete list of contributors
|
40
|
+
|
41
|
+
## Copyright
|
42
|
+
|
43
|
+
Copyright (c) 2011 Socialcast Inc.
|
44
|
+
See LICENSE.txt for further details.
|
45
|
+
|
data/delete_paranoid.gemspec
CHANGED
@@ -14,13 +14,13 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.rubyforge_project = "delete_paranoid"
|
16
16
|
|
17
|
-
s.add_runtime_dependency(%q<activerecord>, ["~> 3.0
|
17
|
+
s.add_runtime_dependency(%q<activerecord>, ["~> 3.0"])
|
18
18
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
19
19
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
20
20
|
s.add_development_dependency(%q<bundler>, [">= 0"])
|
21
21
|
s.add_development_dependency(%q<sqlite3-ruby>, ["~> 1.3.2"])
|
22
|
-
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
23
22
|
s.add_development_dependency(%q<timecop>, [">= 0"])
|
23
|
+
s.add_development_dependency(%q<rake>, [">= 0.9.2.2"])
|
24
24
|
|
25
25
|
s.files = `git ls-files`.split("\n")
|
26
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,139 +1,105 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: delete_paranoid
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 1.0.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Ryan Sonnek
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-01-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: activerecord
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2161280560 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 3
|
32
|
-
- 0
|
33
|
-
- 0
|
34
|
-
version: 3.0.0
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: shoulda
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: *2161280560
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: shoulda
|
27
|
+
requirement: &2161280000 !ruby/object:Gem::Requirement
|
41
28
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
49
33
|
type: :development
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: mocha
|
53
34
|
prerelease: false
|
54
|
-
|
35
|
+
version_requirements: *2161280000
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: mocha
|
38
|
+
requirement: &2161279500 !ruby/object:Gem::Requirement
|
55
39
|
none: false
|
56
|
-
requirements:
|
57
|
-
- -
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
segments:
|
61
|
-
- 0
|
62
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
63
44
|
type: :development
|
64
|
-
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: bundler
|
67
45
|
prerelease: false
|
68
|
-
|
46
|
+
version_requirements: *2161279500
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: &2161278980 !ruby/object:Gem::Requirement
|
69
50
|
none: false
|
70
|
-
requirements:
|
71
|
-
- -
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
|
74
|
-
segments:
|
75
|
-
- 0
|
76
|
-
version: "0"
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
77
55
|
type: :development
|
78
|
-
version_requirements: *id004
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
|
-
name: sqlite3-ruby
|
81
56
|
prerelease: false
|
82
|
-
|
57
|
+
version_requirements: *2161278980
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: sqlite3-ruby
|
60
|
+
requirement: &2161278480 !ruby/object:Gem::Requirement
|
83
61
|
none: false
|
84
|
-
requirements:
|
62
|
+
requirements:
|
85
63
|
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
hash: 31
|
88
|
-
segments:
|
89
|
-
- 1
|
90
|
-
- 3
|
91
|
-
- 2
|
64
|
+
- !ruby/object:Gem::Version
|
92
65
|
version: 1.3.2
|
93
66
|
type: :development
|
94
|
-
version_requirements: *id005
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: ruby-debug
|
97
67
|
prerelease: false
|
98
|
-
|
68
|
+
version_requirements: *2161278480
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: timecop
|
71
|
+
requirement: &2161278000 !ruby/object:Gem::Requirement
|
99
72
|
none: false
|
100
|
-
requirements:
|
101
|
-
- -
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
segments:
|
105
|
-
- 0
|
106
|
-
version: "0"
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
107
77
|
type: :development
|
108
|
-
version_requirements: *id006
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: timecop
|
111
78
|
prerelease: false
|
112
|
-
|
79
|
+
version_requirements: *2161278000
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rake
|
82
|
+
requirement: &2161277520 !ruby/object:Gem::Requirement
|
113
83
|
none: false
|
114
|
-
requirements:
|
115
|
-
- -
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
118
|
-
segments:
|
119
|
-
- 0
|
120
|
-
version: "0"
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 0.9.2.2
|
121
88
|
type: :development
|
122
|
-
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *2161277520
|
123
91
|
description: flag database records as deleted and hide them from subsequent queries
|
124
|
-
email:
|
92
|
+
email:
|
125
93
|
- ryan@codecrate.com
|
126
94
|
executables: []
|
127
|
-
|
128
95
|
extensions: []
|
129
|
-
|
130
96
|
extra_rdoc_files: []
|
131
|
-
|
132
|
-
files:
|
97
|
+
files:
|
133
98
|
- .gitignore
|
99
|
+
- CONTRIBUTORS.txt
|
134
100
|
- Gemfile
|
135
101
|
- LICENSE.txt
|
136
|
-
- README.
|
102
|
+
- README.md
|
137
103
|
- Rakefile
|
138
104
|
- delete_paranoid.gemspec
|
139
105
|
- lib/delete_paranoid.rb
|
@@ -144,41 +110,37 @@ files:
|
|
144
110
|
- test/matchers/callback_matcher.rb
|
145
111
|
- test/matchers/destroy_matcher.rb
|
146
112
|
- test/test_delete_paranoid.rb
|
147
|
-
has_rdoc: true
|
148
113
|
homepage: http://github.com/wireframe/delete_paranoid
|
149
114
|
licenses: []
|
150
|
-
|
151
115
|
post_install_message:
|
152
116
|
rdoc_options: []
|
153
|
-
|
154
|
-
require_paths:
|
117
|
+
require_paths:
|
155
118
|
- lib
|
156
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
120
|
none: false
|
158
|
-
requirements:
|
159
|
-
- -
|
160
|
-
- !ruby/object:Gem::Version
|
161
|
-
|
162
|
-
segments:
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
segments:
|
163
126
|
- 0
|
164
|
-
|
165
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
+
hash: 601821127024587846
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
129
|
none: false
|
167
|
-
requirements:
|
168
|
-
- -
|
169
|
-
- !ruby/object:Gem::Version
|
170
|
-
|
171
|
-
segments:
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
segments:
|
172
135
|
- 0
|
173
|
-
|
136
|
+
hash: 601821127024587846
|
174
137
|
requirements: []
|
175
|
-
|
176
138
|
rubyforge_project: delete_paranoid
|
177
|
-
rubygems_version: 1.
|
139
|
+
rubygems_version: 1.8.13
|
178
140
|
signing_key:
|
179
141
|
specification_version: 3
|
180
142
|
summary: soft delete Rails ActiveRecord objects
|
181
|
-
test_files:
|
143
|
+
test_files:
|
182
144
|
- test/database.yml
|
183
145
|
- test/database_setup.rb
|
184
146
|
- test/helper.rb
|
data/README.rdoc
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
= delete_paranoid
|
2
|
-
|
3
|
-
Soft Delete ActiveRecord instances.
|
4
|
-
|
5
|
-
== Usage
|
6
|
-
class Blog < ActiveRecord::Base
|
7
|
-
acts_as_paranoid
|
8
|
-
end
|
9
|
-
blog = Blog.create! :name => 'foo'
|
10
|
-
|
11
|
-
# soft delete the instance
|
12
|
-
blog.destroy
|
13
|
-
|
14
|
-
# query database for results *including* soft deleted objects
|
15
|
-
Blog.with_deleted do
|
16
|
-
Blog.all
|
17
|
-
end
|
18
|
-
|
19
|
-
# permenantly delete the instance from the database
|
20
|
-
Blog.delete! blog.id
|
21
|
-
|
22
|
-
== Features
|
23
|
-
* simple configuration
|
24
|
-
* preserves existing ActiveRecord API. No magical new API's to use when you want to soft delete a record
|
25
|
-
* automatically exclude soft deleted records from database queries (by default)
|
26
|
-
* support for querying database for all records (including soft deleted ones)
|
27
|
-
* support for permenantly deleting record from database
|
28
|
-
|
29
|
-
== Contributing
|
30
|
-
|
31
|
-
* Fork the project
|
32
|
-
* Fix the issue
|
33
|
-
* Submit a pull request on github
|
34
|
-
|
35
|
-
== Patch acceptance criteria
|
36
|
-
|
37
|
-
* tests must be included
|
38
|
-
|
39
|
-
== Copyright
|
40
|
-
|
41
|
-
Copyright (c) 2011 Ryan Sonnek. See LICENSE.txt for
|
42
|
-
further details.
|
43
|
-
|