apartment 0.9.0 → 0.9.1

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/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.9.1
2
+ * June 24, 2011
3
+
4
+ - Hooks now take the payload object as an argument to fetch the proper db for DJ hooks
5
+
1
6
  # 0.9.0
2
7
  * June 23, 2011
3
8
 
@@ -3,10 +3,13 @@ module Apartment
3
3
  module Job
4
4
 
5
5
  # Before and after hooks for performing Delayed Jobs within a particular apartment database
6
+ # Included these in your delayed jobs models and make sure provide a @database attr that will be serialized by DJ
6
7
  module Hooks
7
8
 
8
- def before
9
- Apartment::Database.switch(Apartment::Database.current_database)
9
+ attr_accessor :database
10
+
11
+ def before(job)
12
+ Apartment::Database.switch(job.payload_object.database) if job.payload_object.database
10
13
  end
11
14
 
12
15
  def after
@@ -1,3 +1,3 @@
1
1
  module Apartment
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: apartment
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.0
5
+ version: 0.9.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ryan Brunner
@@ -186,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - ">="
188
188
  - !ruby/object:Gem::Version
189
- hash: 3220260499656815678
189
+ hash: 749751042564884907
190
190
  segments:
191
191
  - 0
192
192
  version: "0"
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - ">="
197
197
  - !ruby/object:Gem::Version
198
- hash: 3220260499656815678
198
+ hash: 749751042564884907
199
199
  segments:
200
200
  - 0
201
201
  version: "0"