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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 81a6ce132bfed3e01c98e166db83eab36cb957b8
4
- data.tar.gz: 11ec7fa7d9bdb156273fd0b1d03ff02a2a8cd32d
2
+ SHA256:
3
+ metadata.gz: bef110f66940d6e6b6859a21b826fd30185b7c6658f83db6bffecd3aa77c82f6
4
+ data.tar.gz: df7f680a377175cbb05123abf976d1938828648fa6dc95d361692b6757d1af5f
5
5
  SHA512:
6
- metadata.gz: 4058de2a63288c905d3d3c8f1405b0b9736b510d0e97842849c4a78cc5ac1fe4356a59f9a25daff6e898ddac02036d5703d5ae4cb39bddec28b97c6cb456ea46
7
- data.tar.gz: f09b0b279301bf701afdd7fb397d51c4bd0aba12a61cacdb2de92aa3d122e68549f0776793562727e41e1bd335dfe668a4388a580b6b4d36db9af2b0e455a0dc
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=Firm #{ARGV.join(' ')}`"
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
 
@@ -1,6 +1,6 @@
1
1
  module Mongoid
2
2
  # Mongoid::Tenant::VERSION
3
3
  module Tenant
4
- VERSION = '0.3.3'.freeze
4
+ VERSION = '0.3.5'.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.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: 2016-09-05 00:00:00.000000000 Z
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.6.6
72
+ rubygems_version: 2.7.6
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Multiple databases Models for Mongoid documents.