pii_safe_schema 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/pii_safe_schema/pii_column.rb +4 -2
- data/lib/pii_safe_schema/version.rb +1 -1
- data/lib/tasks/pii_safe_schema.rake +3 -2
- 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: 37742fbd9ebda37050c8e0b851cbfaba6a8a6eedc70283e46a393bcdc2baf1c0
|
4
|
+
data.tar.gz: 285e70b4e2aabf1a089471044c6495f685fa9b187cbc5514a42e7d3eafbd8b4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1528541842d2b5af3a78d06ec7711eccb372f317b8f12fc9850435ce4d326dae796ebcbc43c8b2dd355dd24d737eb60c3d4a8d86a098a5d1a784bb06168e9dc6
|
7
|
+
data.tar.gz: cb2af9ed4ac8019c201394ad2e3a4ec5263ce56ca2c1a631b980c8f4252eb4ce2928f003544bdbb1136cf92dfecf6a9b08e9109c3d1958db23e4aa9dd3f96e60
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 1.3.1 - 2019-11-06
|
8
|
+
### Fixed
|
9
|
+
- Passing arguments to `rake pii_safe_schema:generate_migrations` actually works
|
10
|
+
|
7
11
|
## 1.3.0 - 2019-11-04
|
8
12
|
### Added
|
9
13
|
- Can pass explicitly annotate PII columns from the command line as arguments when using `rake pii_safe_schema:generate_migrations`.
|
@@ -15,11 +15,13 @@ module PiiSafeSchema
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def from_column_name(table:, column:, suggestion:)
|
18
|
-
|
18
|
+
activerecord_column = connection.columns(table.to_s).find { |c| c.name == column.to_s }
|
19
|
+
|
20
|
+
unless activerecord_column
|
19
21
|
raise InvalidColumnError, "column \"#{column}\" does not exist for table \"#{table}\""
|
20
22
|
end
|
21
23
|
|
22
|
-
new(table: table, column:
|
24
|
+
new(table: table, column: activerecord_column, suggestion: suggestion)
|
23
25
|
end
|
24
26
|
|
25
27
|
private
|
@@ -9,6 +9,7 @@ namespace :pii_safe_schema do
|
|
9
9
|
PiiSafeSchema.generate_migrations(additional_columns)
|
10
10
|
end
|
11
11
|
|
12
|
+
exit(0) # forces rake to stop after this and not assume args are tasks
|
12
13
|
rescue ActiveRecord::StatementInvalid, PiiSafeSchema::InvalidColumnError => e
|
13
14
|
raise e if e.class == ActiveRecord::StatementInvalid && e.cause.class != PG::UndefinedTable
|
14
15
|
|
@@ -19,7 +20,7 @@ namespace :pii_safe_schema do
|
|
19
20
|
|
20
21
|
Please create the table & columns first, running their migrations, before attempting to use the pii_safe_schema generator.
|
21
22
|
HEREDOC
|
22
|
-
|
23
|
-
exit(
|
23
|
+
|
24
|
+
exit(1) # forces rake to stop after this and not assume args are tasks
|
24
25
|
end
|
25
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pii_safe_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexi Garrow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|