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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bef110f66940d6e6b6859a21b826fd30185b7c6658f83db6bffecd3aa77c82f6
4
- data.tar.gz: df7f680a377175cbb05123abf976d1938828648fa6dc95d361692b6757d1af5f
3
+ metadata.gz: dd48dbbe5d1f746f12d37e531df3a8c70eb32d8d8a4cad6692e85e71a50ccee5
4
+ data.tar.gz: 0267fc86e9e468f73204c007c3412da5b28b5ab3d455eb9f0ec1409c07fbfcc6
5
5
  SHA512:
6
- metadata.gz: 8836bdbc7abbdbc3862e423d85a5b8b2f91835e642789f32a2f06904a148ca833ae0640b7ffd47ade38bb136cccc417a6b4a1c1e4c665d324226e566a1227248
7
- data.tar.gz: 355fd03290d0d0ef37f0de9a7ef67fe5a76b848c62d403111ced3f07aaf4badb0e7a148c849a7ee8e260996fc83ba4deee16b6ebabfb12cc623e68c4b7959c32
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: [:environment, :load_models] do
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
- puts 'Not running tenants: Provide a tenancy model:'
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: [:environment, :load_models] do
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
- puts 'Not running tenants: Provide a tenancy model:'
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: [:environment, :load_models] do
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
@@ -1,6 +1,6 @@
1
1
  module Mongoid
2
2
  # Mongoid::Tenant::VERSION
3
3
  module Tenant
4
- VERSION = '0.3.5'.freeze
4
+ VERSION = '0.3.7'.freeze
5
5
  end
6
6
  end
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.5
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-13 00:00:00.000000000 Z
11
+ date: 2018-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid