bitlove-resque_mailer 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bitlove-resque_mailer.gemspec +2 -2
- data/lib/resque_mailer.rb +8 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.4
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bitlove-resque_mailer"
|
8
|
-
s.version = "2.0.
|
8
|
+
s.version = "2.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nick Plante"]
|
12
|
-
s.date = "2011-10-
|
12
|
+
s.date = "2011-10-07"
|
13
13
|
s.description = "Rails plugin for sending asynchronous email with ActionMailer and Resque"
|
14
14
|
s.email = "nap@zerosum.org"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/resque_mailer.rb
CHANGED
@@ -33,7 +33,7 @@ module Resque
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def perform(action, *args)
|
36
|
-
self.send(:new, action, *args).message.deliver
|
36
|
+
self.send(:new, action, *args.map { |o| o.is_a?(Hash) && o.has_key?("class_name") && o.has_key?("id") ? o["class_name"].constantize.find(o["id"]) : o }).message.deliver
|
37
37
|
end
|
38
38
|
|
39
39
|
def environment_excluded?
|
@@ -61,7 +61,13 @@ module Resque
|
|
61
61
|
def initialize(mailer_class, method_name, *args)
|
62
62
|
@mailer_class = mailer_class
|
63
63
|
@method_name = method_name
|
64
|
-
*@args = *args
|
64
|
+
*@args = *args.map do |object|
|
65
|
+
if object.is_a?(ActiveRecord::Base)
|
66
|
+
{:class_name => object.class.name, :id => object.id}
|
67
|
+
else
|
68
|
+
object
|
69
|
+
end
|
70
|
+
end
|
65
71
|
end
|
66
72
|
|
67
73
|
def resque
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitlove-resque_mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 4
|
10
|
+
version: 2.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nick Plante
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-07 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|