devise-async 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/lib/devise/async/backend/base.rb +5 -1
- data/lib/devise/async/proxy.rb +3 -1
- data/lib/devise/async/version.rb +1 -1
- data/test/devise/async/proxy_test.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -6,8 +6,12 @@ module Devise
|
|
6
6
|
raise NotImplementedError, "Any DeviseAssync::Backend subclass should implement `self.enqueue`."
|
7
7
|
end
|
8
8
|
|
9
|
+
# Loads the resource record and sends the email.
|
10
|
+
#
|
11
|
+
# It uses `orm_adapter` API to fetch the record in order to enforce
|
12
|
+
# compatibility among diferent ORMs.
|
9
13
|
def perform(method, resource_class, resource_id)
|
10
|
-
resource = resource_class.constantize.
|
14
|
+
resource = resource_class.constantize.to_adapter.get!(resource_id)
|
11
15
|
mailer_class.send(method, resource).deliver
|
12
16
|
end
|
13
17
|
|
data/lib/devise/async/proxy.rb
CHANGED
@@ -11,7 +11,9 @@ module Devise
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def deliver
|
14
|
-
|
14
|
+
# Use `id.to_s` to avoid problems with mongoid 2.4.X ids being serialized
|
15
|
+
# wrong with YAJL.
|
16
|
+
Worker.enqueue(@method, @resource.class.name, @resource.id.to_s)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/devise/async/version.rb
CHANGED
@@ -5,7 +5,7 @@ module Devise
|
|
5
5
|
describe "Proxy" do
|
6
6
|
it "gets called by devise operations and proxy to worker" do
|
7
7
|
user = create_user
|
8
|
-
Worker.expects(:enqueue).with(:confirmation_instructions, "User", user.id)
|
8
|
+
Worker.expects(:enqueue).with(:confirmation_instructions, "User", user.id.to_s)
|
9
9
|
user.send_confirmation_instructions
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-async
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -229,7 +229,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
229
229
|
version: '0'
|
230
230
|
segments:
|
231
231
|
- 0
|
232
|
-
hash:
|
232
|
+
hash: 752797920512014551
|
233
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
234
|
none: false
|
235
235
|
requirements:
|
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
238
|
version: '0'
|
239
239
|
segments:
|
240
240
|
- 0
|
241
|
-
hash:
|
241
|
+
hash: 752797920512014551
|
242
242
|
requirements: []
|
243
243
|
rubyforge_project:
|
244
244
|
rubygems_version: 1.8.23
|