penthouse 0.10.1 → 0.11.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a540a09483ff7827355af80b564a62796e698265
4
- data.tar.gz: f12bab76ecd04155e5b0f973768bd1602094bed1
3
+ metadata.gz: a1b6d19ee617c554c080a828dbce840a3431879a
4
+ data.tar.gz: b4c6b6ae7398e7b0bb78e5b17539865a3479e1ee
5
5
  SHA512:
6
- metadata.gz: 114e39f5fe4562765d631f685d5f96381354109e3376de368555f20b43f35b408a024130cf5ba406bdea26e01db20b2d139f21a0ec13361db3ab0f8c4cff5da3
7
- data.tar.gz: 298151315806a14957da6539121dc64917a2c4dcf71d979187db560dcdebe1803871ee5d59f3667b71d49c98ca64cdddaaf8a8182fb39d0c98c6b38455d9efd0
6
+ metadata.gz: 51ef4839e0ffcfcc637b82732e167f49e90e96e077d319d55ed483247ae2176e284770c6a05a4a214704adea35f41d004929cecff799e9431869fc3a4a6fa5fb
7
+ data.tar.gz: 8cef1801324324d687794256e80f5622505f0f8ce74715a5508c923b546519fc80895f1f746b69e7a71be1384a769d37d969f595871787cdc3a731157c39c9a3
data/README.md CHANGED
@@ -18,8 +18,10 @@ If you're using Rails, you just need to configure an initializer at `config/init
18
18
  require 'penthouse'
19
19
  # include the standard Rack app
20
20
  require 'penthouse/app'
21
- # include the automated Sidekiq integration, should you be using it
21
+ # include the automated Sidekiq integration, should you need it
22
22
  require 'penthouse/sidekiq' if defined?(Sidekiq)
23
+ # include the automated ActiveJob integration, should you need it
24
+ require 'penthouse/active_job' if defined?(ActiveJob)
23
25
  # require the relevant router/runner you wish to use
24
26
  require 'penthouse/routers/subdomain_router'
25
27
  require 'penthouse/runners/schema_runner'
@@ -0,0 +1,17 @@
1
+ module Penthouse
2
+ module ActiveJob
3
+ extend ActiveSupport::Concern
4
+
5
+ class_methods do
6
+ def execute(job_data)
7
+ Penthouse.switch(job_data['tenant']) do
8
+ super
9
+ end
10
+ end
11
+ end
12
+
13
+ def serialize
14
+ super.merge('tenant' => Penthouse.tenant)
15
+ end
16
+ end
17
+ end
@@ -3,7 +3,7 @@ module Penthouse
3
3
  module Middleware
4
4
  class Client
5
5
  def call(worker_class, item, queue, redis_pool=nil)
6
- item['tenant'] ||= Penthouse.current_tenant
6
+ item['tenant'] ||= Penthouse.tenant
7
7
  yield
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Penthouse
2
- VERSION = "0.10.1"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: penthouse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Townsend
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -196,6 +196,7 @@ files:
196
196
  - bin/console
197
197
  - bin/setup
198
198
  - lib/penthouse.rb
199
+ - lib/penthouse/active_job.rb
199
200
  - lib/penthouse/app.rb
200
201
  - lib/penthouse/configuration.rb
201
202
  - lib/penthouse/migrator.rb