mongoid-simple-userstamps 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/mongoid-simple-userstamps/model.rb +2 -2
- data/lib/mongoid-simple-userstamps/version.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: 7123312aed4696e240e1e23468c2454b841ba67d
|
4
|
+
data.tar.gz: 819baa4411adafdf3357a4b56a46daaadc3a3e36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3a8461955bc75e1e2d26ba54d5a9962ded5913a718b351157af9a33fa95f443ea984e8b3a0842da4daf769e0adbb5e74ebd338edca5ad65e799558d58bef0a4
|
7
|
+
data.tar.gz: 6dd9aff620666f58b06249aa042a279cc4877f8ee85904640e117ccf422b6a33216d5a41c02aa4992e5abfe46dcf4a9c3cd28a21558f3e4d0292db2818dacc98
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Adds stamps relations to mongoid models.
|
|
4
4
|
|
5
5
|
## Version Support
|
6
6
|
|
7
|
-
Mongoid 5.x
|
7
|
+
Mongoid 5.x, 6.x
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -45,7 +45,7 @@ Or install it yourself as:
|
|
45
45
|
pòst = Post.create
|
46
46
|
post.created_by # <User _id: 57305c268675c32e1c70a17e >
|
47
47
|
post.updated_by # nil
|
48
|
-
|
48
|
+
|
49
49
|
post.title = 'title'
|
50
50
|
post.save
|
51
51
|
post.updated_by # <User _id: 57305c268675c32e1c70a17e >
|
@@ -5,8 +5,8 @@ module Mongoid
|
|
5
5
|
module Userstamps
|
6
6
|
module Model
|
7
7
|
def self.included(base)
|
8
|
-
base.send(:belongs_to, :created_by,
|
9
|
-
base.send(:belongs_to, :updated_by,
|
8
|
+
base.send(:belongs_to, :created_by, polymorphic: true, optional: true)
|
9
|
+
base.send(:belongs_to, :updated_by, polymorphic: true, optional: true)
|
10
10
|
|
11
11
|
base.send(:before_create) do
|
12
12
|
if Mongoid::Userstamps::Config.current && !self.created_by
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-simple-userstamps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Jurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|