mongoid-archivable 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +2 -2
- data/lib/mongoid/archivable/version.rb +1 -1
- data/lib/mongoid/archivable.rb +5 -3
- data/lib/mongoid-archivable.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 882a65795699b33897ddba5e2ecaceb74e042b43
|
4
|
+
data.tar.gz: bd7db46dc3563b3dea8f8b0ac93e2fc1d44fb366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78b50ca2778ef1cd19004fdb77eab86649f905829f3349c43944c54b697330a15a28ee9ce651c4eb7308b7ac5f7bf4745b08c0f3f4412de83c7ae0720ea6d738
|
7
|
+
data.tar.gz: febf1f46eeb4d18c4c9120456384012ad25f626ad6e09f25f68373e7bb1515e952cae99211b63ef6af61f9f5a9cd777c6b6b7d98cac4ed284dae4dd997232d69
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.2
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
In any Mongoid document, do this:
|
26
26
|
|
27
|
-
```
|
27
|
+
```ruby
|
28
28
|
include Mongoid::Archivable
|
29
29
|
```
|
30
30
|
|
@@ -34,7 +34,7 @@ You can restore an archive as well. Send the `.restore` message to it. For now t
|
|
34
34
|
|
35
35
|
## Example
|
36
36
|
|
37
|
-
```
|
37
|
+
```ruby
|
38
38
|
user = User.create! name: "Example User"
|
39
39
|
user.destroy
|
40
40
|
|
data/lib/mongoid/archivable.rb
CHANGED
@@ -12,9 +12,11 @@ module Mongoid
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def original_document
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
@original_document ||= begin
|
16
|
+
excluded_attributes = %w(_id original_id original_type archived_at)
|
17
|
+
original_class_name.constantize.new(attributes.except(*excluded_attributes)) do |doc|
|
18
|
+
doc.id = original_id
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
data/lib/mongoid-archivable.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
1
|
+
require 'mongoid/archivable/version'
|
2
2
|
require 'mongoid/archivable'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-archivable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joost Baaij
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.4.8
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Move Mongoid documents to an archive instead of destroying them.
|