stairwell 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -3
- data/lib/stairwell/core_extensions/core.rb +6 -0
- data/lib/stairwell/query.rb +2 -2
- data/lib/stairwell/type_validator.rb +2 -1
- data/lib/stairwell/version.rb +1 -1
- 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: 7846f146e7d718b2c1dacaaf795e2093c3f24a5a4ee520a2821c6a3bb23d2ca2
|
4
|
+
data.tar.gz: 3b39deebbb1db67dd063953d92899b4cc4b94a96fda740a0c6b2173ef28e7c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e678fe8b202b64ba0d2abbd1771983fc2a72c9a757478c6cfac163af7985b68f8e2d47458a01715b81c756153f6858963cb6d3d59ed9223d089ff6fdebeb01e
|
7
|
+
data.tar.gz: 7fe23548a55c4ea1eb3f10d1ab8eb375699f7849e084af9346eee041fef19c5129558952b662d4814adbb0439f5e5af17bce02f27884f58fc0e8c3adf01dc483
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stairwell (0.1.
|
5
|
-
zeitwerk (~> 2.4.0)
|
4
|
+
stairwell (0.1.1)
|
6
5
|
|
7
6
|
GEM
|
8
7
|
remote: https://rubygems.org/
|
@@ -14,7 +13,6 @@ GEM
|
|
14
13
|
coderay (~> 1.1)
|
15
14
|
method_source (~> 1.0)
|
16
15
|
rake (12.3.3)
|
17
|
-
zeitwerk (2.4.0)
|
18
16
|
|
19
17
|
PLATFORMS
|
20
18
|
ruby
|
data/lib/stairwell/query.rb
CHANGED
@@ -2,7 +2,7 @@ module Stairwell
|
|
2
2
|
class Query
|
3
3
|
|
4
4
|
class << self
|
5
|
-
attr_accessor :bind_hash, :all_validations, :sql_string
|
5
|
+
attr_accessor :bind_hash, :all_validations, :sql_string
|
6
6
|
|
7
7
|
def validate_type(*args)
|
8
8
|
@all_validations ||= {}
|
@@ -11,7 +11,6 @@ module Stairwell
|
|
11
11
|
|
12
12
|
def sql(**args)
|
13
13
|
@bind_hash = args
|
14
|
-
@bind_object_array = []
|
15
14
|
validate!
|
16
15
|
transformed_sql_string
|
17
16
|
end
|
@@ -27,6 +26,7 @@ module Stairwell
|
|
27
26
|
|
28
27
|
bind_hash.each do |bind_name, bind_value|
|
29
28
|
type = all_validations[bind_name]
|
29
|
+
type = type.first if type.is_a?(Array)
|
30
30
|
valid = TypeValidator.send(type, bind_value)
|
31
31
|
|
32
32
|
raise InvalidBindType.new("#{bind_name} is not #{all_validations[bind_name]}") unless valid
|
data/lib/stairwell/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stairwell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tobyond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Sanitize and quote raw SQL for rails and any project in ruby
|
14
14
|
email:
|