mongoid-tenant 0.3.3 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/mongoid/tenant/tasks/tenant.rake +17 -1
- data/lib/mongoid/tenant/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bef110f66940d6e6b6859a21b826fd30185b7c6658f83db6bffecd3aa77c82f6
|
4
|
+
data.tar.gz: df7f680a377175cbb05123abf976d1938828648fa6dc95d361692b6757d1af5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8836bdbc7abbdbc3862e423d85a5b8b2f91835e642789f32a2f06904a148ca833ae0640b7ffd47ade38bb136cccc417a6b4a1c1e4c665d324226e566a1227248
|
7
|
+
data.tar.gz: 355fd03290d0d0ef37f0de9a7ef67fe5a76b848c62d403111ced3f07aaf4badb0e7a148c849a7ee8e260996fc83ba4deee16b6ebabfb12cc623e68c4b7959c32
|
@@ -27,7 +27,23 @@ namespace :db do
|
|
27
27
|
end
|
28
28
|
else
|
29
29
|
puts 'Not running tenants: Provide a tenancy model:'
|
30
|
-
puts "`TENANCY=
|
30
|
+
puts "`TENANCY=Model #{ARGV.join(' ')}`"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Remove Mongoid indexes, tenant aware'
|
35
|
+
task remove_indexes: [:environment, :load_models] do
|
36
|
+
# Run once, for tables outside tenancy
|
37
|
+
::Mongoid::Tasks::Database.remove_indexes(non_tenancy_models)
|
38
|
+
if tenancy_env
|
39
|
+
Object.const_get(tenancy_env).active_tenants.each do |t|
|
40
|
+
puts "Tenant #{t}"
|
41
|
+
t.tenancy!
|
42
|
+
::Mongoid::Tasks::Database.remove_indexes(tenancy_models)
|
43
|
+
end
|
44
|
+
else
|
45
|
+
puts 'Not running tenants: Provide a tenancy model:'
|
46
|
+
puts "`TENANCY=Model #{ARGV.join(' ')}`"
|
31
47
|
end
|
32
48
|
end
|
33
49
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-tenant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
71
|
rubyforge_project: mongoid-tenant
|
72
|
-
rubygems_version: 2.
|
72
|
+
rubygems_version: 2.7.6
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Multiple databases Models for Mongoid documents.
|