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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d50d572399ef8aad94f755387ef533184f0e388
4
- data.tar.gz: 8264616bebf8f77d7a69debf55a22ff726e0b785
3
+ metadata.gz: 882a65795699b33897ddba5e2ecaceb74e042b43
4
+ data.tar.gz: bd7db46dc3563b3dea8f8b0ac93e2fc1d44fb366
5
5
  SHA512:
6
- metadata.gz: f5d2c60138624e372d6d7b3685163981c6b9581ac155f8a64297895af72bc087dbedb6ab83dc4eefdb5ce2659c150b6f0fda11e11c0278cc858976e645908936
7
- data.tar.gz: be2cae93f19ab0567812f09d05d830454f482b2c5ae0e8906fffcf4f70fe2ec2a13e5d8e73e71ff0e7e3afd28ac24ef70b6efa6b4806a6a0427da3d1c1609f4c
6
+ metadata.gz: 78b50ca2778ef1cd19004fdb77eab86649f905829f3349c43944c54b697330a15a28ee9ce651c4eb7308b7ac5f7bf4745b08c0f3f4412de83c7ae0720ea6d738
7
+ data.tar.gz: febf1f46eeb4d18c4c9120456384012ad25f626ad6e09f25f68373e7bb1515e952cae99211b63ef6af61f9f5a9cd777c6b6b7d98cac4ed284dae4dd997232d69
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.4
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
 
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Archivable
3
- VERSION = "1.4.1"
3
+ VERSION = '1.4.2'.freeze
4
4
  end
5
5
  end
@@ -12,9 +12,11 @@ module Mongoid
12
12
  end
13
13
 
14
14
  def original_document
15
- excluded_attributes = %w(_id original_id original_type archived_at)
16
- original_class_name.constantize.new(attributes.except(*excluded_attributes)) do |doc|
17
- doc.id = original_id
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
 
@@ -1,2 +1,2 @@
1
- require "mongoid/archivable/version"
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.1
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-02-10 00:00:00.000000000 Z
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.2.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.