mongoid-undo 0.11.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/lib/mongoid/undo.rb +6 -2
- data/lib/mongoid/undo/version.rb +1 -1
- data/mongoid-undo.gemspec +3 -1
- data/test/mongoid.yml +0 -2
- metadata +33 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19492347296216836cfe8a40b1994b0a49aaabc3
|
4
|
+
data.tar.gz: 786e77d26b1a74aefeb94f5878d4c778dc65a191
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 554821f592b475c4f591173d15879e70410a9f487a5aa11a9f8d8fa344dd2d79ece62c290fe334c1a6c051daa5ccede15b3b474d82a1a433cd3fe201a738d5fb
|
7
|
+
data.tar.gz: 5f4297de289c8ee64076bc708d5477ff7cfebdbc0523942fb753783a34a91231472b2f07f5e55a5edb11ff3084e7c8e2d0e55c0f92b8399d584ce820254819da
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
|
-
# 0.
|
1
|
+
# 0.11.0 (June 29, 2014)
|
2
|
+
* Adds undoable? (and respectively redoable?) methods to check whether a new version was saved or not.
|
3
|
+
|
4
|
+
# 0.10.1 (April 16, 2014)
|
5
|
+
* Switches to non anonymous callbacks.
|
6
|
+
|
7
|
+
# 0.10.0 (March 30, 2014)
|
2
8
|
* Adds both callbacks for undo and redo.
|
3
9
|
|
10
|
+
# 0.9.1 (February 17, 2014)
|
11
|
+
* We are still on minitest 4. 😞
|
12
|
+
|
13
|
+
# 0.9.0 (February 17, 2014)
|
14
|
+
* Whoa! Removes ruby version from Gemfile.
|
15
|
+
|
16
|
+
# 0.8.0 (February 10, 2014)
|
17
|
+
* Fixes \#2: updated_at-columns not working anymore.
|
18
|
+
|
4
19
|
# 0.7.0 (February 8, 2014)
|
5
20
|
* Simpler tests.
|
6
21
|
|
data/lib/mongoid/undo.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'mongoid'
|
3
|
+
require 'mongoid/paranoia'
|
4
|
+
require 'mongoid/versioning'
|
3
5
|
|
4
6
|
module Mongoid
|
5
7
|
module Undo
|
@@ -7,9 +9,11 @@ module Mongoid
|
|
7
9
|
|
8
10
|
include Mongoid::Paranoia
|
9
11
|
include Mongoid::Versioning
|
10
|
-
include Mongoid::
|
12
|
+
include Mongoid::Interceptable
|
11
13
|
|
12
14
|
included do
|
15
|
+
# _id must be marked as not-versioned
|
16
|
+
fields['_id'].options.merge!(versioned: false)
|
13
17
|
field :action, type: Symbol, versioned: false
|
14
18
|
index deleted_at: 1
|
15
19
|
|
@@ -56,7 +60,7 @@ module Mongoid
|
|
56
60
|
|
57
61
|
private
|
58
62
|
def retrieve
|
59
|
-
|
63
|
+
update versions.last.versioned_attributes.except('version', 'updated_at')
|
60
64
|
end
|
61
65
|
end
|
62
66
|
end
|
data/lib/mongoid/undo/version.rb
CHANGED
data/mongoid-undo.gemspec
CHANGED
@@ -14,5 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.require_path = 'lib'
|
15
15
|
|
16
16
|
gem.add_dependency 'activesupport'
|
17
|
-
gem.add_dependency 'mongoid', '
|
17
|
+
gem.add_dependency 'mongoid', '~> 4.0.0'
|
18
|
+
gem.add_dependency 'mongoid-paranoia', '~> 1.0.0'
|
19
|
+
gem.add_dependency 'mongoid-versioning', '~> 1.0.0'
|
18
20
|
end
|
data/test/mongoid.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-undo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Uher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -28,22 +28,44 @@ dependencies:
|
|
28
28
|
name: mongoid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
|
33
|
+
version: 4.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mongoid-paranoia
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
35
46
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
47
|
+
version: 1.0.0
|
37
48
|
type: :runtime
|
38
49
|
prerelease: false
|
39
50
|
version_requirements: !ruby/object:Gem::Requirement
|
40
51
|
requirements:
|
41
|
-
- - "
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mongoid-versioning
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
42
60
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
-
|
61
|
+
version: 1.0.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
45
67
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
68
|
+
version: 1.0.0
|
47
69
|
description: mongoid-undo provides a super simple and easy to use undo system for
|
48
70
|
Mongoid apps.
|
49
71
|
email: uher.mario@gmail.com
|
@@ -86,3 +108,4 @@ signing_key:
|
|
86
108
|
specification_version: 4
|
87
109
|
summary: Super simple undo for your Mongoid app.
|
88
110
|
test_files: []
|
111
|
+
has_rdoc:
|