acts_as_tenant 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWRkOGI4YTQ3YWJiNDZmMDg5YmQ5ZjZiNGVlNzRjZGUzOGYyYTYxMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2I2OTE5NTlmZmM2NDk1MDY5NzIyMGFhMjMwOGU1ODRkOTRlNTg1Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2EwYmZlNTU5Y2RmM2YyMjQzNjE2MjljY2I1YjIxYThkZjllNTExYzY3OTRh
|
10
|
+
Y2U3YzAyYzc2NGRlNGUyYmY1NjY1MTdkZmNjMGNkMzFkNzE1MjRjNWU2OTQz
|
11
|
+
YjljN2I3OTk2MjQxNmM4YjAzMzQwMzFmMmY0MGVhZjNiMDBmOTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTQ2ZjZmMzMwYTc0NmZlMjYyMzg0OGE4MTQ2NWMxYjc5ODYwMTNmNWMzMjJm
|
14
|
+
Yzg4NzJiOTU0MjcyMGE1ZGQxMjc5Zjk4NTJkMWU5YWNjNDBjZWE2OTlmNTE2
|
15
|
+
NWIwYjAxYjkwNGRiMjIzNGY2YmVlYmFmYWQyMTNhMTgyYzIzODU=
|
data/CHANGELOG.md
CHANGED
@@ -53,7 +53,7 @@ module ActsAsTenant
|
|
53
53
|
if ActsAsTenant.configuration.require_tenant && ActsAsTenant.current_tenant.nil?
|
54
54
|
raise ActsAsTenant::Errors::NoTenantSet
|
55
55
|
end
|
56
|
-
where("#{self.table_name}.#{fkey}
|
56
|
+
where({"#{self.table_name}.#{fkey}" => ActsAsTenant.current_tenant.id}) if ActsAsTenant.current_tenant
|
57
57
|
}
|
58
58
|
|
59
59
|
# Add the following validations to the receiving model:
|
@@ -136,6 +136,14 @@ describe ActsAsTenant do
|
|
136
136
|
it { lambda { @project.account = @account }.should_not raise_error }
|
137
137
|
end
|
138
138
|
|
139
|
+
describe 'tenant_id should auto populate after initialization' do
|
140
|
+
before do
|
141
|
+
@account = Account.create!(:name => 'foo')
|
142
|
+
ActsAsTenant.current_tenant = @account
|
143
|
+
end
|
144
|
+
it {Project.new.account_id.should == @account.id}
|
145
|
+
end
|
146
|
+
|
139
147
|
describe 'Handles custom foreign_key on tenant model' do
|
140
148
|
before do
|
141
149
|
@account = Account.create!(:name => 'foo')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_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
|
- Erwin Matthijssen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: request_store
|