mongoid-tenant 0.3.5 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid/tenant/tasks/tenant.rake +11 -7
- data/lib/mongoid/tenant/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd48dbbe5d1f746f12d37e531df3a8c70eb32d8d8a4cad6692e85e71a50ccee5
|
4
|
+
data.tar.gz: 0267fc86e9e468f73204c007c3412da5b28b5ab3d455eb9f0ec1409c07fbfcc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df33f7dd5a28366550e3c03ccf084891f82164046dd452d8986bba7e0401eb95ad95d30a1a65d0af64a0900cce4f7ef2cfa592e35fc0a7a1e5543b894687a6d
|
7
|
+
data.tar.gz: 27b048a08b8f7a5d62c9592ebaa84f53633d711641332d347021839016b87bbf7f0f67e48f72a96fbf2297b10464e96e1da577b1d917f4c6449586d8f2d2553a
|
@@ -1,4 +1,5 @@
|
|
1
1
|
Rake::Task['db:mongoid:create_indexes'].clear
|
2
|
+
Rake::Task['db:mongoid:remove_indexes'].clear
|
2
3
|
Rake::Task['db:mongoid:remove_undefined_indexes'].clear
|
3
4
|
|
4
5
|
namespace :db do
|
@@ -15,8 +16,13 @@ namespace :db do
|
|
15
16
|
::Mongoid.models.reject { |k| k.include?(::Mongoid::Tenant) }
|
16
17
|
end
|
17
18
|
|
19
|
+
def puts_warning
|
20
|
+
puts 'Not running tenants... Provide a tenancy model:'
|
21
|
+
puts "`TENANCY=Model #{ARGV.join(' ')}`"
|
22
|
+
end
|
23
|
+
|
18
24
|
desc 'Create Mongoid indexes, tenant aware'
|
19
|
-
task create_indexes: [
|
25
|
+
task create_indexes: %i[environment load_models] do
|
20
26
|
# Run once, for tables outside tenancy
|
21
27
|
::Mongoid::Tasks::Database.create_indexes(non_tenancy_models)
|
22
28
|
if tenancy_env
|
@@ -26,13 +32,12 @@ namespace :db do
|
|
26
32
|
::Mongoid::Tasks::Database.create_indexes(tenancy_models)
|
27
33
|
end
|
28
34
|
else
|
29
|
-
|
30
|
-
puts "`TENANCY=Model #{ARGV.join(' ')}`"
|
35
|
+
puts_warning
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
34
39
|
desc 'Remove Mongoid indexes, tenant aware'
|
35
|
-
task remove_indexes: [
|
40
|
+
task remove_indexes: %i[environment load_models] do
|
36
41
|
# Run once, for tables outside tenancy
|
37
42
|
::Mongoid::Tasks::Database.remove_indexes(non_tenancy_models)
|
38
43
|
if tenancy_env
|
@@ -42,13 +47,12 @@ namespace :db do
|
|
42
47
|
::Mongoid::Tasks::Database.remove_indexes(tenancy_models)
|
43
48
|
end
|
44
49
|
else
|
45
|
-
|
46
|
-
puts "`TENANCY=Model #{ARGV.join(' ')}`"
|
50
|
+
puts_warning
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
50
54
|
desc 'Removes undefined Mongoid indexes, tenant aware'
|
51
|
-
task remove_undefined_indexes: [
|
55
|
+
task remove_undefined_indexes: %i[environment load_models] do
|
52
56
|
# Run once, for tables outside tenancy
|
53
57
|
::Mongoid::Tasks::Database.remove_undefined_indexes(non_tenancy_models)
|
54
58
|
if tenancy_env
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|