midb 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/midb/server_model.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9821cd0f1f71f4e4c626f0197e2c425b27c84885
|
4
|
+
data.tar.gz: 48ba776f73d9e56730c668271bc7a553f0ed6d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 448e8d6c0cb6d71d645939fe5b3bd98b92712adbaf47f42f372bc2807696e7355689cd956a373eca28594e3a35468b13cc0f80627162fe91606d4e63f2a56967
|
7
|
+
data.tar.gz: 5c54118c7da5ff00ef97dfc9f05e8057aaeeddd591317f95eabfc3ba8781da386950345e5da70a5245a9e40f929ca14d1f2bb9272fd6d43a0323f62995b1f168
|
data/lib/midb/server_model.rb
CHANGED
@@ -118,7 +118,7 @@ module MIDB
|
|
118
118
|
db = MIDB::DbengineModel.new
|
119
119
|
dbc = db.connect()
|
120
120
|
dbq = db.query(dbc, "SELECT * FROM #{self.get_structure.values[0].split('/')[0]} WHERE id=#{id};")
|
121
|
-
unless
|
121
|
+
unless db.length(dbq) > 0
|
122
122
|
resp = MIDB::ServerView.json_error(404, "ID not found")
|
123
123
|
MIDB::ServerController.http_status = 404
|
124
124
|
bad_request = true
|
@@ -174,7 +174,7 @@ module MIDB
|
|
174
174
|
db = MIDB::DbengineModel.new
|
175
175
|
dbc = db.connect()
|
176
176
|
dbq = db.query(dbc, "SELECT * FROM #{self.get_structure.values[0].split('/')[0]} WHERE id=#{id};")
|
177
|
-
if not
|
177
|
+
if not db.length(dbq) > 0
|
178
178
|
resp = MIDB::ServerView.json_error(404, "ID not found").to_json
|
179
179
|
MIDB::ServerController.http_status = 404
|
180
180
|
bad_request = true
|
@@ -228,7 +228,7 @@ module MIDB
|
|
228
228
|
dbe = MIDB::DbengineModel.new()
|
229
229
|
dblink = dbe.connect()
|
230
230
|
rows = dbe.query(dblink, "SELECT * FROM #{self.get_structure.values[0].split('/')[0]} WHERE id=#{id};")
|
231
|
-
if
|
231
|
+
if dblink.length(rows) > 0
|
232
232
|
rows.each do |row|
|
233
233
|
jso[row["id"]] = self.get_structure
|
234
234
|
|