penthouse 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/penthouse/migrator.rb +17 -2
- data/lib/penthouse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32ab9a7ff6f0e7826504ba972ef2e1adae7bf070
|
4
|
+
data.tar.gz: 4a9420802af74ec2ce0f60d70310e7a41a893371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11eba9239610c2272df4e59240c783ff09bac032d9ea03886956314e598d1fb57d1740f87cbce9ff44955d09c994143e52a5f5dd9bcf4c370434db057027a29
|
7
|
+
data.tar.gz: ef6e226f6ad688a0d49ac8616c8309b4a87bf48997b62e343647dc4fd590f81dc10ba89a459cae93e1920a87fa1e664afcdee8b3417fc3c93d32d1ea63ff8da3
|
data/lib/penthouse/migrator.rb
CHANGED
@@ -42,6 +42,8 @@ module Penthouse
|
|
42
42
|
|
43
43
|
module ClassMethods
|
44
44
|
def migrate_with_penthouse(migrations_paths, target_version = nil, &block)
|
45
|
+
puts "#migrate_with_penthouse called"
|
46
|
+
|
45
47
|
unless Penthouse.configuration.migrate_tenants?
|
46
48
|
puts "Skipping penthouse integration"
|
47
49
|
return migrate_without_penthouse(migrations_paths, target_version, &block)
|
@@ -60,6 +62,8 @@ module Penthouse
|
|
60
62
|
end
|
61
63
|
|
62
64
|
def up_with_penthouse(migrations_paths, target_version = nil, &block)
|
65
|
+
puts "#up_with_penthouse called"
|
66
|
+
|
63
67
|
unless Penthouse.configuration.migrate_tenants?
|
64
68
|
puts "Skipping penthouse integration"
|
65
69
|
return up_without_penthouse(migrations_paths, target_version, &block)
|
@@ -78,6 +82,8 @@ module Penthouse
|
|
78
82
|
end
|
79
83
|
|
80
84
|
def down_with_penthouse(migrations_paths, target_version = nil, &block)
|
85
|
+
puts "#down_with_penthouse called"
|
86
|
+
|
81
87
|
unless Penthouse.configuration.migrate_tenants?
|
82
88
|
puts "Skipping penthouse integration"
|
83
89
|
return down_without_penthouse(migrations_paths, target_version, &block)
|
@@ -96,6 +102,8 @@ module Penthouse
|
|
96
102
|
end
|
97
103
|
|
98
104
|
def run_with_penthouse(direction, migrations_paths, target_version)
|
105
|
+
puts "#run_with_penthouse called"
|
106
|
+
|
99
107
|
unless Penthouse.configuration.migrate_tenants?
|
100
108
|
puts "Skipping penthouse integration"
|
101
109
|
return run_without_penthouse(direction, migrations_paths, target_version)
|
@@ -114,9 +122,16 @@ module Penthouse
|
|
114
122
|
end
|
115
123
|
|
116
124
|
def tenants_to_migrate
|
117
|
-
if (
|
118
|
-
|
125
|
+
return @tenants_to_migrate if defined?(@tenants_to_migrate)
|
126
|
+
@tenants_to_migrate = begin
|
127
|
+
if (t = ENV["TENANT"] || ENV["TENANTS"])
|
128
|
+
t.split(",").map(&:strip)
|
129
|
+
else
|
130
|
+
Penthouse.tenant_identifiers
|
131
|
+
end
|
119
132
|
end
|
133
|
+
puts "#tenants_to_migrate = #{@tenants_to_migrate}"
|
134
|
+
@tenants_to_migrate
|
120
135
|
end
|
121
136
|
end
|
122
137
|
end
|
data/lib/penthouse/version.rb
CHANGED