data-anonymization 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utils/database.rb +1 -1
- data/lib/version.rb +1 -1
- data/spec/utils/database_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a3da98d682c6d4c804dd3a02163941374ffef2581961a86c4cd854cc764b557
|
4
|
+
data.tar.gz: 9d0ea5dea0878140d7c889ac701f2da31e0932471e7470051ef9f1f0677e3523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b929f6b8c62208837b90914318fd5a81ed6f61d10aa07550d294956cb9d26a7d03b2159ecf1a303d49e358c3ea0ea163eb4a32815be8c08fe12367609b3acd61
|
7
|
+
data.tar.gz: dadfeaa41cf64ed801f44a18feb29b2a7bd09614400dd7941d1cc67f55cbfe38ef5fb1e924b2d665995768110ed7096a81aaac2aef9c47647d6f52d7ef15a3f8
|
data/lib/utils/database.rb
CHANGED
@@ -25,7 +25,7 @@ module DataAnon
|
|
25
25
|
|
26
26
|
def self.create_table database, table_name, primary_keys = []
|
27
27
|
klass_name = table_name.to_s.downcase.capitalize
|
28
|
-
return database.const_get
|
28
|
+
return database.const_get(klass_name, false) if database.const_defined?(klass_name, false)
|
29
29
|
database.const_set(klass_name, Class.new(database) do
|
30
30
|
self.table_name = table_name
|
31
31
|
self.primary_keys = primary_keys if primary_keys.length > 1
|
data/lib/version.rb
CHANGED
data/spec/utils/database_spec.rb
CHANGED
@@ -16,6 +16,12 @@ describe 'Utils' do
|
|
16
16
|
album.all.length > 0
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'ignores inherited constants when creating a table with matching name' do
|
20
|
+
conditionals = DataAnon::Utils::SourceTable.create 'Conditionals'
|
21
|
+
conditionals.count.should == 0
|
22
|
+
conditionals.all.length == 0
|
23
|
+
end
|
24
|
+
|
19
25
|
it 'should test the connection to destination database' do
|
20
26
|
album = DataAnon::Utils::DestinationTable.create 'Album', ['AlbumId']
|
21
27
|
album.count.should == 0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data-anonymization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sunit Parekh
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-10-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|