mongoid-archivable 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid/archivable/version.rb +1 -1
- data/lib/mongoid/archivable.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 971dca70add99ed3cc798f9e4ed83daaccc69aaf
|
4
|
+
data.tar.gz: 043e3d3d71ad79494169137ad2920a17efed9111
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aad631225297e7e89130f4a919370935e7250c2d8ccf611203505323e274b2aa84f850bb521f6185e5e3244844cfa1cb446b620b939c1007cc374ef3a774fac
|
7
|
+
data.tar.gz: aae341b6b79edcad33457008ce696b80dd870ae473d90bdb2260ddc935b4a3cbf15d434d14f76bdf2b432e9ad61e0a1881908f73e752683c0e23949afba559b7
|
data/lib/mongoid/archivable.rb
CHANGED
@@ -8,7 +8,7 @@ module Mongoid
|
|
8
8
|
module Restoration
|
9
9
|
# Restores the archived document to its former glory.
|
10
10
|
def restore
|
11
|
-
document = self.class.to_s.
|
11
|
+
document = self.class.to_s.gsub(/::Archive\z/, '') # Turns User::Archive into User.
|
12
12
|
|
13
13
|
self.class.const_get(document).create(attributes.except("_id", "original_id", "archived_at")) do |doc|
|
14
14
|
doc.id = self.original_id
|
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
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joost Baaij
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|