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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9ea19bc1addf3c6339916689f55362f43462bab
4
- data.tar.gz: e2b83cbdc64fe4784e4d07b4ec0deb812e492855
3
+ metadata.gz: bf67fd15675a0569d38edc5c15ff65a5b0c4ae37
4
+ data.tar.gz: 06b02d26ec56cdaf0706d42504ba48ce3995d16e
5
5
  SHA512:
6
- metadata.gz: cefb4712ced5728293d6be2f423d0712547f0dc0f9a0eb5bacde9453b715ab2becb3372a82f1f11ffcfa0a8d46ac3f08e80ea5f32011e7db458de3cd51f4499a
7
- data.tar.gz: cc22e8b91f49cd75df775842c0a97c7a39b26c75e90c98f5fa8eabde77a6bfa195d13be0e290adca80373da51c1f4eb96ee1df60e33ff185fa65d448b7d9e92b
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
- if ! self.records_processed.include?(record)
29
- self.records_processed << record
30
- ActivityEngine::Activity.new.tap {|activity|
31
- activity.subject = record
32
- activity.user = current_user if respond_to?(:current_user)
33
- activity.activity_type = "#{controller_name}##{action_name}"
34
- }.save!
35
- end
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
@@ -1,3 +1,3 @@
1
1
  module ActivityEngine
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  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.8
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-26 00:00:00.000000000 Z
11
+ date: 2013-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails