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
- MDI0NjdkNWMzYTNjMDk2OTI4YjIxMmM1YmNmOThmOGVkYmU5MGQ1Yg==
4
+ NWRkOGI4YTQ3YWJiNDZmMDg5YmQ5ZjZiNGVlNzRjZGUzOGYyYTYxMw==
5
5
  data.tar.gz: !binary |-
6
- MjIxYTJjNmU0MTI1ZGJiZjEyNDNiOTcyMjhjNDk5Yjg5ZjExZDA3ZA==
6
+ M2I2OTE5NTlmZmM2NDk1MDY5NzIyMGFhMjMwOGU1ODRkOTRlNTg1Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzUxZmM0MzIyMjM1NWMxMThmNjk5NDE0NmUyYzNjMDk3NWNlODI0NWM3YWIw
10
- NjVjMmMxOGZhODRjZDJiOTRmYjJkZjQ3YmJjZDc0YzgwZTBiNDRmY2ZkMjdk
11
- MzU2MTBlYTZjM2EzODM1NTY4OGVkMGU3YzU5ZTA3MzdjMzA1ODc=
9
+ Y2EwYmZlNTU5Y2RmM2YyMjQzNjE2MjljY2I1YjIxYThkZjllNTExYzY3OTRh
10
+ Y2U3YzAyYzc2NGRlNGUyYmY1NjY1MTdkZmNjMGNkMzFkNzE1MjRjNWU2OTQz
11
+ YjljN2I3OTk2MjQxNmM4YjAzMzQwMzFmMmY0MGVhZjNiMDBmOTc=
12
12
  data.tar.gz: !binary |-
13
- YjY1ZjM4Yzc5ZTJkZTU3Y2YyNDU1MjMxNjI0OGVlYzQ1NDA2ODA3NTgzY2Ex
14
- Zjg1MGM5YTdiMDNkNWQwZTUxZGZlZDljNmEzYjYxZDEzYmM3NTJmYjQxZDVi
15
- NGEyMGY2MGE4MzRmMzFjMzU3OWZjZWE0NDg0ZTQ1NGMxZmYwOWY=
13
+ OTQ2ZjZmMzMwYTc0NmZlMjYyMzg0OGE4MTQ2NWMxYjc5ODYwMTNmNWMzMjJm
14
+ Yzg4NzJiOTU0MjcyMGE1ZGQxMjc5Zjk4NTJkMWU5YWNjNDBjZWE2OTlmNTE2
15
+ NWIwYjAxYjkwNGRiMjIzNGY2YmVlYmFmYWQyMTNhMTgyYzIzODU=
@@ -1,3 +1,7 @@
1
+ 0.3.5
2
+ -----
3
+ * Fix to degredation introduced after 3.1 that prevented tenant_id from being set during initialization (thx jorgevaldivia)
4
+
1
5
  0.3.4
2
6
  -----
3
7
  * Fix to a bug introduced in 0.3.2
@@ -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} = ?", ActsAsTenant.current_tenant.id) if ActsAsTenant.current_tenant
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:
@@ -1,3 +1,3 @@
1
1
  module ActsAsTenant
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -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
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-24 00:00:00.000000000 Z
11
+ date: 2014-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: request_store