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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c887499fc91768e2d5545a2c6dbf439e08885e2c
4
- data.tar.gz: 895ff222f43ed6753a1f7ad0e1c9be176ff0c15e
3
+ metadata.gz: 971dca70add99ed3cc798f9e4ed83daaccc69aaf
4
+ data.tar.gz: 043e3d3d71ad79494169137ad2920a17efed9111
5
5
  SHA512:
6
- metadata.gz: 9ad8ecb9ba0cf5b05bea72627f93075af85f9d3a152efc5df806b6fced2dfe369fd654f43d228f78338d7fd9155eb76a320ae9b538dd02101cb74edd1e4e364c
7
- data.tar.gz: c569029340b31e767cdab0cd24e2b0e3610baa80ed2001e3ff8276865545658202bf5c5b60cecede36b80cb417878c3bd83df4f2639861a9b5b121939e4fd3df
6
+ metadata.gz: 4aad631225297e7e89130f4a919370935e7250c2d8ccf611203505323e274b2aa84f850bb521f6185e5e3244844cfa1cb446b620b939c1007cc374ef3a774fac
7
+ data.tar.gz: aae341b6b79edcad33457008ce696b80dd870ae473d90bdb2260ddc935b4a3cbf15d434d14f76bdf2b432e9ad61e0a1881908f73e752683c0e23949afba559b7
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Archivable
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -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.split('::').first # Turns User::Archive into User.
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.1.0
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-04-14 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid