mongoid_activity_tracker 0.2.2 → 0.2.3

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: 970637cdf4055b8c9cf4374886b4bb8bd438c318
4
- data.tar.gz: 689bfb1ab5c6e3b01a0a18cfd4cae48bf7392672
3
+ metadata.gz: b91662553f642b59840c5fd733fbcae5f3b2bf28
4
+ data.tar.gz: 98a0b2667979ea41acf595c925fb52ae0b0d0073
5
5
  SHA512:
6
- metadata.gz: e53650908cc0b5cbf874215fa728862603b766247f9e946af239dce40857d6a37fe3ced400ad5a7de50cbdae361dcb0d3f4c50c71d486cb866e67d6853ce1974
7
- data.tar.gz: bec8d7f1975e21b484b3a9ed5ce0f9bf14d6a0018b26959f95dfa764fb2d67a89a718477dcfea92af9a8c321c31edfeac25be4d40f4fb9e3d69d247d2a1e115b
6
+ metadata.gz: d19e08ff77bf23fb19481accd6711d1d17d54ac31bb30367d423cb14e9023eeb38cf42e40c8c387141f39743c798d02c591e935b3962803cb692b1dcc290182d
7
+ data.tar.gz: bd61c47fbb603c0b22244b37792447c5c608bd8777179d8bbace9bb11ab0cbcb043eaba4d8af38ad5adba0af629b7466637c053f12dd141eefe21defef42cc74
@@ -10,6 +10,10 @@ module MongoidActivityTracker
10
10
  create({ action: action, actor: actor }.merge(options))
11
11
  end
12
12
 
13
+ def track!(actor, action, options = {})
14
+ create!({ action: action, actor: actor }.merge(options))
15
+ end
16
+
13
17
  # ---------------------------------------------------------------------
14
18
 
15
19
  def tracks(relation_name, cache_methods: %i(to_s))
@@ -19,7 +23,7 @@ module MongoidActivityTracker
19
23
 
20
24
  field field_name, type: Hash, default: {}
21
25
 
22
- belongs_to relation_name, polymorphic: true
26
+ belongs_to relation_name, polymorphic: true, optional: true
23
27
 
24
28
  attr_accessor accessor_name
25
29
 
@@ -1,3 +1,3 @@
1
1
  module MongoidActivityTracker
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_activity_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-24 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid