kit 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kit/db_sqlite3.rb +2 -3
- metadata +3 -3
data/lib/kit/db_sqlite3.rb
CHANGED
@@ -131,7 +131,7 @@ class Backend < Kit
|
|
131
131
|
# @param [Symbol] table what database table to query
|
132
132
|
# @param [Array] fields list of column names to return
|
133
133
|
# @param [Integer] id rowid of record to return
|
134
|
-
# @return [
|
134
|
+
# @return [Hash] first matched row with a key for each requested field
|
135
135
|
def select_info_by_id table, fields, id
|
136
136
|
info = @info_db.select fields, "FROM `#{table}` WHERE `rowid` = '#{id}'"
|
137
137
|
info.first
|
@@ -151,7 +151,7 @@ class Backend < Kit
|
|
151
151
|
# @param table (see #select_info_by_id)
|
152
152
|
# @param fields (see #select_info_by_id)
|
153
153
|
# @param [Hash] criteria key / value pairs required to match
|
154
|
-
# @return
|
154
|
+
# @return [Array] hash for each returned row with a key for each requested field
|
155
155
|
def select_info_by_criteria table, fields, criteria
|
156
156
|
q = []
|
157
157
|
criteria.each do |key, value|
|
@@ -159,7 +159,6 @@ class Backend < Kit
|
|
159
159
|
end
|
160
160
|
|
161
161
|
info = @info_db.select fields, "FROM `#{table}` WHERE #{q.join " AND "}"
|
162
|
-
info.first
|
163
162
|
end
|
164
163
|
|
165
164
|
# Inserts a new row into an info table.
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Evan Boyd Sosenko
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-08-06 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|