audited-deferrable 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # audited-deferrable
2
2
 
3
- Extension to the audited gem to deferred writing of audits via Resque, but with modular architecture to support adding other providers such as sidekiq and delayed job (pull requests, please!)
3
+ Extension to the audited gem to defer writing of audits via Resque, but with modular architecture to support adding other providers such as sidekiq and delayed job (pull requests, please!)
4
4
 
5
5
  NOTE: This currently only works with Resque v1, not Resque v2 which is a different API. I'd gladly accept pull requests supporting both.
6
6
 
@@ -16,7 +16,7 @@ In an initializer (config/initializers/audited.rb):
16
16
 
17
17
  Audited.defer_with = :resque
18
18
 
19
- After this, all of your audits will be written to the resque queue, and to completely them you'll need to run a resque worker:
19
+ After this, all of your audits will be written to the resque queue, and to complete them you'll need to run a resque worker:
20
20
 
21
21
  $ QUEUE=audited rake environment resque:work
22
22
 
@@ -19,8 +19,8 @@ module Audited
19
19
  end
20
20
 
21
21
  def self.from_arguments(object_class_name, object_id, user_class_name, user_id, attrs)
22
- object = object_class_name.constantize.find(object_id)
23
- user = user_class_name.constantize.find(user_id) if user_class_name
22
+ object = object_class_name.constantize.find(object_id) rescue nil
23
+ user = user_class_name.constantize.find(user_id) rescue nil if user_class_name
24
24
  new(object, user, attrs)
25
25
  end
26
26
 
@@ -29,8 +29,12 @@ module Audited
29
29
  end
30
30
 
31
31
  def work
32
- Audited.audit_class.as_user(@user) do
33
- @object.send(:write_audit_without_deferrable, @attrs)
32
+ if @object
33
+ Audited.audit_class.as_user(@user) do
34
+ @object.send(:write_audit_without_deferrable, @attrs)
35
+ end
36
+ else
37
+ false
34
38
  end
35
39
  end
36
40
 
@@ -1,5 +1,5 @@
1
1
  module Audited
2
2
  module Deferrable
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audited-deferrable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-15 00:00:00.000000000 Z
12
+ date: 2013-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70329449422300 !ruby/object:Gem::Requirement
16
+ requirement: &70282313946680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70329449422300
24
+ version_requirements: *70282313946680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: audited
27
- requirement: &70329449420780 !ruby/object:Gem::Requirement
27
+ requirement: &70282313946100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70329449420780
35
+ version_requirements: *70282313946100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70329449418760 !ruby/object:Gem::Requirement
38
+ requirement: &70282313945480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.13'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70329449418760
46
+ version_requirements: *70282313945480
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: appraisal
49
- requirement: &70329449416480 !ruby/object:Gem::Requirement
49
+ requirement: &70282313944920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.5.1
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70329449416480
57
+ version_requirements: *70282313944920
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: sqlite3-ruby
60
- requirement: &70329449434560 !ruby/object:Gem::Requirement
60
+ requirement: &70282313944320 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 1.3.1
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70329449434560
68
+ version_requirements: *70282313944320
69
69
  description: Extension to the audited gem to deferred writing of audits via Resque,
70
70
  Delayed Job, or Sidekiq
71
71
  email: ben@railsgarden.com
@@ -80,7 +80,8 @@ files:
80
80
  - LICENSE
81
81
  - README.md
82
82
  homepage: http://github.com/rubiety/audited-deferrable
83
- licenses: []
83
+ licenses:
84
+ - MIT
84
85
  post_install_message:
85
86
  rdoc_options: []
86
87
  require_paths: