apartment 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +5 -0
- data/lib/apartment/adapters/mysql2_adapter.rb +2 -2
- data/lib/apartment/deprecation.rb +4 -7
- data/lib/apartment/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25a8f63a3b5e73c32fde8b9aa28f45dabaa44008
|
4
|
+
data.tar.gz: 789fc81fa177f663c4c78e3f46f492f0a55b60f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1af4150a26a832f33b80ab5099e4d625275861d2ed9815418a6243ec4c05e48b1d7abd85e12f750073d1f0753c5421b86c2f6fb5f4504e0d12ea934ca20ad1a8
|
7
|
+
data.tar.gz: 37cb6bc1da7d8bff326b11013e9bc789a1c0d265f255f1753094a560719ddbabc91ffd48b8afb77c5985bcc658ef1e7ce8f644c592113212ea4ef47b96865056
|
data/HISTORY.md
CHANGED
@@ -46,7 +46,7 @@ module Apartment
|
|
46
46
|
# Reset current tenant to the default_tenant
|
47
47
|
#
|
48
48
|
def reset
|
49
|
-
Apartment.connection.execute "use
|
49
|
+
Apartment.connection.execute "use `#{default_tenant}`"
|
50
50
|
end
|
51
51
|
|
52
52
|
# Set the table_name to always use the default tenant for excluded models
|
@@ -62,7 +62,7 @@ module Apartment
|
|
62
62
|
def connect_to_new(tenant)
|
63
63
|
return reset if tenant.nil?
|
64
64
|
|
65
|
-
Apartment.connection.execute "use
|
65
|
+
Apartment.connection.execute "use `#{environmentify(tenant)}`"
|
66
66
|
|
67
67
|
rescue ActiveRecord::StatementInvalid
|
68
68
|
Apartment::Tenant.reset
|
@@ -1,13 +1,10 @@
|
|
1
|
+
require 'active_support/deprecation'
|
2
|
+
|
1
3
|
module Apartment
|
2
4
|
module Deprecation
|
3
5
|
|
4
6
|
def self.warn(message)
|
5
|
-
|
6
|
-
ActiveSupport::Deprecation.warn message
|
7
|
-
rescue
|
8
|
-
warn message
|
9
|
-
end
|
7
|
+
ActiveSupport::Deprecation.warn message
|
10
8
|
end
|
11
|
-
|
12
9
|
end
|
13
|
-
end
|
10
|
+
end
|
data/lib/apartment/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apartment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brunner
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
339
|
version: '0'
|
340
340
|
requirements: []
|
341
341
|
rubyforge_project:
|
342
|
-
rubygems_version: 2.4.
|
342
|
+
rubygems_version: 2.4.6
|
343
343
|
signing_key:
|
344
344
|
specification_version: 4
|
345
345
|
summary: A Ruby gem for managing database multitenancy
|