penthouse 0.13.1 → 0.13.2

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: 854fad97b263d6042e0357bb314be21a63348e20
4
- data.tar.gz: 92a8edbd37b913445882aa13ab96ef5548e23c1e
3
+ metadata.gz: 8c2e9ea2e2050c4d3fb6cdebf4fe2f67b2f46fb7
4
+ data.tar.gz: fdb5f602860f1df7d5d27edc5d04bb2e49ddc094
5
5
  SHA512:
6
- metadata.gz: 4ca4d3f0bb3f8a5880282af29bdd2ff72ded608bf807b0ba1c034d805c5bcfba24a5ec9f22f686ada34a8178ead4892c404576a59a374079267dcb4b3cd5290c
7
- data.tar.gz: b238b18877e7e32246891aa139e0ec8f478e24b30b345a22885069e7fb163ad0337c218257b678ebd92573c8094380e82877ee6f2cde0edcc4bd0374dc838837
6
+ metadata.gz: 6014dccb942c05d20cabb3f0889fbba43654102c8e1c22aebca85b915e5368856f395196351e23453eba98db05ef88f1c3a9c8e4e1c38fc1cb436a38df625e94
7
+ data.tar.gz: a4c880830a3f95446d8d52c99bbcca3836f34906712fc7e33b282a7374578146f635e0f7212813f726f812567409c0663f06535c39b2fe5f7d90a7fbc6217764
@@ -21,30 +21,36 @@ module Penthouse
21
21
  # @yield [SchemaTenant] The current tenant instance
22
22
  # @return [void]
23
23
  def call(shard: Octopus.master_shard, &block)
24
- Octopus.using(shard) do
25
- super(&block)
26
- end
24
+ switch_shard(shard: shard) { super(&block) }
27
25
  end
28
26
 
29
27
  # creates the tenant schema within the master shard
30
28
  # @see Penthouse::Tenants::SchemaTenant#create
31
29
  # @return [void]
32
30
  def create(**)
33
- call { super }
31
+ switch_shard(shard: Octopus.master_shard) { super }
34
32
  end
35
33
 
36
34
  # drops the tenant schema within the master shard
37
35
  # @see Penthouse::Tenants::SchemaTenant#delete
38
36
  # @return [void]
39
37
  def delete(**)
40
- call { super }
38
+ switch_shard(shard: Octopus.master_shard) { super }
41
39
  end
42
40
 
43
41
  # returns whether or not the schema exists
44
42
  # @see Penthouse::Tenants::SchemaTenant#exists?
45
43
  # @return [Boolean] whether or not the schema exists in the master shard
46
44
  def exists?(**)
47
- call { super }
45
+ switch_shard(shard: Octopus.master_shard) { super }
46
+ end
47
+
48
+ private
49
+
50
+ def switch_shard(shard:, &block)
51
+ Octopus.using(shard) do
52
+ block.call
53
+ end
48
54
  end
49
55
  end
50
56
  end
@@ -1,3 +1,3 @@
1
1
  module Penthouse
2
- VERSION = "0.13.1"
2
+ VERSION = "0.13.2"
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.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Townsend
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-14 00:00:00.000000000 Z
11
+ date: 2018-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler