json2sql 1.0.13 → 1.0.15

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: 6282183f873d4f4e32d0c0819c43ffe20ce53dbabd71bb44ba26b362edbaf9d7
4
- data.tar.gz: 1aa18874f4bbfc9f1ac395b357babb98f3884f577f2fe8d3d81d7f647cbfc2ba
3
+ metadata.gz: 698df3c08077bb25df5b606c6cc419891dad06698053d5af5e5fb451d33a9c1c
4
+ data.tar.gz: 5e7469e5e323e7226f7a200fbd60daaedc92d1cefdcac7efd78ba8cfd1680897
5
5
  SHA512:
6
- metadata.gz: 7e84fdd24a2efa2eb464d85df3a3ec3b8370d204bb4d64676dcb953e2777bb34d3bc0807eb0e2fc9c65ffb167911ce89a3c3606a7bcb66d20698b0e617801f81
7
- data.tar.gz: 9b6f1b82866c8ff0d96af65439ed0a2b6f96592ecde63187b1d91ed27a513d92a3f57077c06862e2582f31342c62f18dabed2f08577a067f358760e5e07161c4
6
+ metadata.gz: 685484a3bc90af693415f4d9bc20321b256e1279b52edcb5abe554195532f205076f3ca5c7e54c627e757f69a1029f9d5acb4eb1f479755503d9eb0208813c25
7
+ data.tar.gz: 4558dc87daef35b1b26805fb8d49f35ad1bc67d80395f94fa52ef13ffa1a9c474bb7842a878275e611aafe157496529ff59b1f625537b13f949a6973efe827cc
@@ -5,7 +5,7 @@ module Json2sql
5
5
  # Parameters:
6
6
  # mode: :allow (default) — only tables listed in `tables:` are accessible.
7
7
  # Tables absent from `tables:` are blocked entirely.
8
- # Empty `tables:` = no restriction.
8
+ # Empty `tables:` = all tables blocked.
9
9
  # :deny — all tables pass. After column filtering, tables
10
10
  # with no remaining accessible columns are removed.
11
11
  # Same rule applies to children and parents.
@@ -95,7 +95,11 @@ module Json2sql
95
95
 
96
96
  def empty_columns?(params)
97
97
 
98
- params.is_a?(Hash) && params["columns"].is_a?(Array) && params["columns"].empty?
98
+ return false unless params.is_a?(Hash)
99
+
100
+ cols = params["columns"]
101
+
102
+ (cols.is_a?(Array) || cols.is_a?(Hash)) && cols.empty?
99
103
  end
100
104
 
101
105
  def filter_tables(params, config)
@@ -106,8 +110,6 @@ module Json2sql
106
110
 
107
111
  tables = config.is_a?(Hash) ? config : {}
108
112
 
109
- return if tables.empty?
110
-
111
113
  params.select! { |table, _| tables.key?(table) }
112
114
  end
113
115
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Json2sql
4
- VERSION = "1.0.13"
4
+ VERSION = "1.0.15"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json2sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago da Silva