condition 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +3 -0
- data/lib/condition/storage/rails_db.rb +11 -1
- data/lib/condition/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5410ab767d8d2e0e9c14630ed646499c4fbbf4e
|
4
|
+
data.tar.gz: fe717b2359aaf06e799c950de566b29ad1b12bd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33c4c9e9f16f35dd3be746bc5698bc2d26bad4374eda95fc0e8f1b75502db6a7e2fd39420da6c46c3d0a87f846ba1102c4b4f8402fbfca8bf6c1a44840f7ba80
|
7
|
+
data.tar.gz: 5f81fcaff8b4415fde5774ad0c1d47685dd56643ac78948093ccc19d6dd117ade99d35360e647600a8f0cae4a150a9d659f76eb3fc79723fd01894de9caa364d
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,8 @@ module Condition
|
|
14
14
|
def all(param_item)
|
15
15
|
sql = "SELECT * FROM #{param_item.name}"
|
16
16
|
res = exec(sql)
|
17
|
-
res.to_hash
|
17
|
+
#res.to_hash
|
18
|
+
convert_keys(res)
|
18
19
|
end
|
19
20
|
|
20
21
|
def delete(param_item)
|
@@ -52,6 +53,7 @@ module Condition
|
|
52
53
|
|
53
54
|
private
|
54
55
|
def quote_value(val)
|
56
|
+
return 'NULL' if val.nil?
|
55
57
|
v = val.gsub(/'/, "''")
|
56
58
|
"'#{v}'"
|
57
59
|
end
|
@@ -59,6 +61,14 @@ module Condition
|
|
59
61
|
def exec(sql)
|
60
62
|
@conn.exec_query(sql, LOG_NAME, [])
|
61
63
|
end
|
64
|
+
|
65
|
+
def convert_keys(ary)
|
66
|
+
res = []
|
67
|
+
ary.each do |row|
|
68
|
+
res.push(row.deep_symbolize_keys)
|
69
|
+
end
|
70
|
+
res
|
71
|
+
end
|
62
72
|
end
|
63
73
|
end
|
64
74
|
end
|
data/lib/condition/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: condition
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aoyagikouhei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.4.
|
202
|
+
rubygems_version: 2.4.8
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Condition Test
|