activity_engine 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activity_engine/activity_sweeper.rb +11 -8
- data/lib/activity_engine/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: bf67fd15675a0569d38edc5c15ff65a5b0c4ae37
|
4
|
+
data.tar.gz: 06b02d26ec56cdaf0706d42504ba48ce3995d16e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf4d494383e087138b081d76e1235b1b338cb399237eec324a12468101d89c160affdb65e31141a235cf316cb3b5f36b19eeae96e056c062252b80316aae7fe9
|
7
|
+
data.tar.gz: b632801061f30c1610031638bbd54728d0c4cfe6edeb20b925117dbbbd995144ebd2fb5595a4313002e2ec57d2b1800d42d59195854a170aa0592b392e1aa1ac
|
@@ -25,14 +25,17 @@ module ActivityEngine
|
|
25
25
|
|
26
26
|
def after_save(record)
|
27
27
|
self.records_processed ||= []
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
# Because the sweeper is now attached as an observer I don't want every
|
29
|
+
# save of the record to trigger this behavior.
|
30
|
+
return true unless controller
|
31
|
+
return true if self.records_processed.include?(record)
|
32
|
+
|
33
|
+
self.records_processed << record
|
34
|
+
ActivityEngine::Activity.new.tap {|activity|
|
35
|
+
activity.subject = record
|
36
|
+
activity.user = current_user if respond_to?(:current_user)
|
37
|
+
activity.activity_type = "#{controller_name}##{action_name}"
|
38
|
+
}.save
|
36
39
|
true
|
37
40
|
end
|
38
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activity_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|