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 CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.1.1
4
+
5
+ * Fixes
6
+ * Changed the way we store the record id in the queue to enforce
7
+ compatibility with diferent ORMs
8
+
3
9
  ## 0.1.0
4
10
 
5
11
  * New
@@ -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.find(resource_id)
14
+ resource = resource_class.constantize.to_adapter.get!(resource_id)
11
15
  mailer_class.send(method, resource).deliver
12
16
  end
13
17
 
@@ -11,7 +11,9 @@ module Devise
11
11
  end
12
12
 
13
13
  def deliver
14
- Worker.enqueue(@method, @resource.class.name, @resource.id)
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
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module Async
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -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.0
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-05-27 00:00:00.000000000 Z
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: 3668830136326538611
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: 3668830136326538611
241
+ hash: 752797920512014551
242
242
  requirements: []
243
243
  rubyforge_project:
244
244
  rubygems_version: 1.8.23