pii_safe_schema 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a3fe6f6dc02bc520f523874f6111cb00dc9201687f0b7f668dc39e587080bda
4
- data.tar.gz: c2f2bf99f36d65c806e9b74af88ab55a8c77291e5bd61883a36bd2b2bf2d6b1b
3
+ metadata.gz: 37742fbd9ebda37050c8e0b851cbfaba6a8a6eedc70283e46a393bcdc2baf1c0
4
+ data.tar.gz: 285e70b4e2aabf1a089471044c6495f685fa9b187cbc5514a42e7d3eafbd8b4b
5
5
  SHA512:
6
- metadata.gz: 539795ee77529477a46a52df234f0474f5d774f2ded25537520f20d023af8539c5643f3c859e3df56e3181591cea9b854b23030be1d5f4c9344dec6b3b7d7f29
7
- data.tar.gz: 8ed9a5f69eeeca205128085268198732888632563922be5402129779074f314df3bf18ad54b17a859372fb90c2689a2b140352bd02f9fa9275950b75667deb67
6
+ metadata.gz: 1528541842d2b5af3a78d06ec7711eccb372f317b8f12fc9850435ce4d326dae796ebcbc43c8b2dd355dd24d737eb60c3d4a8d86a098a5d1a784bb06168e9dc6
7
+ data.tar.gz: cb2af9ed4ac8019c201394ad2e3a4ec5263ce56ca2c1a631b980c8f4252eb4ce2928f003544bdbb1136cf92dfecf6a9b08e9109c3d1958db23e4aa9dd3f96e60
@@ -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
- unless connection.columns(table.to_s).find { |c| c.name == column.to_s }
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: column, suggestion: suggestion)
24
+ new(table: table, column: activerecord_column, suggestion: suggestion)
23
25
  end
24
26
 
25
27
  private
@@ -1,3 +1,3 @@
1
1
  module PiiSafeSchema
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.3.1'.freeze
3
3
  end
@@ -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
- ensure
23
- exit(0) # forces rake to stop after this and not assume args are tasks
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.0
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-06 00:00:00.000000000 Z
11
+ date: 2019-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport