query_report 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,7 +61,16 @@ module QueryReport
61
61
  end
62
62
 
63
63
  def rowspan?
64
- @options[:rowspan] == true
64
+ @options[:rowspan] == true || @options[:rowspan].kind_of?(Symbol)
65
+ end
66
+
67
+ def rowspan_column_humanized
68
+ rowspan_column_name = @options[:rowspan].kind_of?(Symbol) ? @options[:rowspan] : self.name
69
+
70
+ report.columns.each do |column|
71
+ return column.humanize if column.name == rowspan_column_name
72
+ end
73
+ return self.humanize
65
74
  end
66
75
 
67
76
  def humanize
@@ -77,7 +86,7 @@ module QueryReport
77
86
  end
78
87
 
79
88
  def total
80
- @total ||= has_total? ? report.records.inject(0) {|sum, r| sum + r[humanize].to_f } : nil
89
+ @total ||= has_total? ? report.records.inject(0) { |sum, r| sum + r[humanize].to_f } : nil
81
90
  end
82
91
  end
83
92
  end
@@ -56,24 +56,43 @@ module QueryReport
56
56
  @all_records_with_rowspan ||= map_rowspan(all_records)
57
57
  end
58
58
 
59
- def map_rowspan(rec)
59
+ def map_rowspan(recs)
60
60
  last_reset_index = @columns.select(&:rowspan?).inject({}) { |hash, column| hash[column.humanize] = 0; hash }
61
- last_column_content = {}
62
- rec.each_with_index do |row, index|
61
+ rowspan_column_hash = @columns.select(&:rowspan?).inject({}) { |hash, column| hash[column.humanize] = column.rowspan_column_humanized; hash }
62
+
63
+ prev_row = {}
64
+ recs.each_with_index do |row, index|
63
65
  last_reset_index.each do |col, last_index|
66
+ rowspan_col = rowspan_column_hash[col]
67
+
68
+ rowspan_content = get_content_from_element(row[rowspan_col]) #picking the current content of the rowspan column
69
+ prev_rowspan_content = get_content_from_element(prev_row[rowspan_col]) #picking the last rowspan content stored
70
+
64
71
  content = row[col]
65
- last_content = last_column_content[col]
66
- if index == 0 || content != last_content
67
- last_column_content[col] = content
68
- last_reset_index[col] = index
72
+ prev_content = get_content_from_element(prev_row[col])
73
+
74
+ if index == 0 || rowspan_content != prev_rowspan_content || content != prev_content
75
+ last_reset_index[col] = index
69
76
  #initialize
70
77
  row[col] = {content: content, rowspan: 1}
71
- elsif content == last_content
72
- rec[last_index][col][:rowspan] += 1
73
- row.delete col
78
+ elsif rowspan_content == prev_rowspan_content
79
+ recs[last_index][col][:rowspan] += 1
74
80
  end
75
81
  end
82
+
83
+ prev_row = row
76
84
  end
85
+
86
+ #cleaning up the un needed row values
87
+ recs.each do |row|
88
+ last_reset_index.each do |col, last_index|
89
+ row.delete col unless row[col].kind_of?(Hash)
90
+ end
91
+ end
92
+ end
93
+
94
+ def get_content_from_element(content)
95
+ content.kind_of?(Hash) ? content[:content] : content
77
96
  end
78
97
  end
79
98
  end
@@ -1,3 +1,3 @@
1
1
  module QueryReport
2
- VERSION = "1.0.12"
2
+ VERSION = "1.0.13"
3
3
  end
@@ -46176,3 +46176,347 @@ Connecting to database specified by database.yml
46176
46176
  SQL (0.1ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 09 Oct 2013 17:02:50 UTC +00:00], ["dob", Tue, 09 Oct 1979 17:02:50 UTC +00:00], ["name", "User#3"], ["updated_at", Wed, 09 Oct 2013 17:02:50 UTC +00:00]]
46177
46177
   (0.0ms) commit transaction
46178
46178
  User Load (0.1ms) SELECT "users".* FROM "users"
46179
+ Connecting to database specified by database.yml
46180
+ Connecting to database specified by database.yml
46181
+ Connecting to database specified by database.yml
46182
+ Connecting to database specified by database.yml
46183
+ Connecting to database specified by database.yml
46184
+ Connecting to database specified by database.yml
46185
+ Connecting to database specified by database.yml
46186
+ Connecting to database specified by database.yml
46187
+ Connecting to database specified by database.yml
46188
+ Connecting to database specified by database.yml
46189
+ Connecting to database specified by database.yml
46190
+ Connecting to database specified by database.yml
46191
+ Connecting to database specified by database.yml
46192
+ Connecting to database specified by database.yml
46193
+ Connecting to database specified by database.yml
46194
+ Connecting to database specified by database.yml
46195
+ Connecting to database specified by database.yml
46196
+ Connecting to database specified by database.yml
46197
+ Connecting to database specified by database.yml
46198
+ Connecting to database specified by database.yml
46199
+ Connecting to database specified by database.yml
46200
+ Connecting to database specified by database.yml
46201
+ Connecting to database specified by database.yml
46202
+ Connecting to database specified by database.yml
46203
+ Connecting to database specified by database.yml
46204
+ Connecting to database specified by database.yml
46205
+ Connecting to database specified by database.yml
46206
+ Connecting to database specified by database.yml
46207
+ Connecting to database specified by database.yml
46208
+ Connecting to database specified by database.yml
46209
+ Connecting to database specified by database.yml
46210
+ Connecting to database specified by database.yml
46211
+ Connecting to database specified by database.yml
46212
+ Connecting to database specified by database.yml
46213
+ Connecting to database specified by database.yml
46214
+ Connecting to database specified by database.yml
46215
+ Connecting to database specified by database.yml
46216
+ Connecting to database specified by database.yml
46217
+ Connecting to database specified by database.yml
46218
+ Connecting to database specified by database.yml
46219
+ Connecting to database specified by database.yml
46220
+ Connecting to database specified by database.yml
46221
+ Connecting to database specified by database.yml
46222
+ Connecting to database specified by database.yml
46223
+ Connecting to database specified by database.yml
46224
+ Connecting to database specified by database.yml
46225
+  (1.7ms) select sqlite_version(*)
46226
+  (0.3ms) CREATE TABLE "gem_defined_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "age" integer)
46227
+  (0.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "age" integer, "dob" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
46228
+  (0.1ms) CREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255))
46229
+  (0.1ms) CREATE TABLE "readerships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "book_id" integer) 
46230
+  (0.1ms) CREATE TABLE "authorships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "book_id" integer)
46231
+  (0.1ms) CREATE TABLE "user_addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "street" varchar(255), "user_id" integer) 
46232
+  (0.1ms) begin transaction
46233
+ SQL (48.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 30], ["created_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00], ["dob", nil], ["name", "Jitu"], ["updated_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00]]
46234
+  (0.1ms) commit transaction
46235
+  (0.1ms) begin transaction
46236
+ SQL (0.2ms) INSERT INTO "readerships" ("book_id", "user_id") VALUES (?, ?) [["book_id", nil], ["user_id", 1]]
46237
+  (0.1ms) commit transaction
46238
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
46239
+ User Load (0.2ms) SELECT "users".* FROM "users" 
46240
+  (0.1ms) begin transaction
46241
+ SQL (0.2ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
46242
+  (0.1ms) commit transaction
46243
+  (0.1ms) begin transaction
46244
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:28:19 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00]]
46245
+  (0.1ms) commit transaction
46246
+  (0.1ms) begin transaction
46247
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:28:19 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00]]
46248
+  (0.1ms) commit transaction
46249
+  (0.1ms) begin transaction
46250
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00], ["dob", Tue, 30 Oct 1979 05:28:19 UTC +00:00], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:28:19 UTC +00:00]]
46251
+  (0.1ms) commit transaction
46252
+ User Load (0.2ms) SELECT "users".* FROM "users"
46253
+ User Load (0.3ms) SELECT "users".* FROM "users" 
46254
+  (0.1ms) begin transaction
46255
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
46256
+  (0.1ms) commit transaction
46257
+  (0.1ms) begin transaction
46258
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
46259
+  (0.1ms) commit transaction
46260
+  (0.1ms) begin transaction
46261
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
46262
+  (0.1ms) commit transaction
46263
+  (0.1ms) begin transaction
46264
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:28:20 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:28:20 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:28:20 UTC +00:00]]
46265
+  (0.1ms) commit transaction
46266
+  (0.1ms) begin transaction
46267
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:28:20 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:28:20 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:28:20 UTC +00:00]]
46268
+  (0.1ms) commit transaction
46269
+  (0.1ms) begin transaction
46270
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:28:20 UTC +00:00], ["dob", Tue, 30 Oct 1979 05:28:20 UTC +00:00], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:28:20 UTC +00:00]]
46271
+  (0.1ms) commit transaction
46272
+  (0.2ms) SELECT AVG("users"."age") AS avg_id FROM "users"
46273
+  (0.1ms) SELECT AVG("users"."age") AS avg_id FROM "users" 
46274
+ User Load (0.2ms) SELECT "users".* FROM "users"
46275
+ User Load (0.3ms) SELECT "users".* FROM "users" 
46276
+  (0.1ms) begin transaction
46277
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 5]]
46278
+  (0.1ms) commit transaction
46279
+  (0.1ms) begin transaction
46280
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 6]]
46281
+  (0.1ms) commit transaction
46282
+  (0.1ms) begin transaction
46283
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 7]]
46284
+  (0.1ms) commit transaction
46285
+  (0.1ms) begin transaction
46286
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:28:23 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46287
+  (0.1ms) commit transaction
46288
+  (0.1ms) begin transaction
46289
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:28:23 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46290
+  (0.1ms) commit transaction
46291
+  (0.1ms) begin transaction
46292
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Tue, 30 Oct 1979 05:28:23 UTC +00:00], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46293
+  (0.1ms) commit transaction
46294
+ User Load (0.2ms) SELECT "users".* FROM "users"
46295
+ User Load (0.3ms) SELECT "users".* FROM "users" 
46296
+  (0.1ms) begin transaction
46297
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 8]]
46298
+  (0.1ms) commit transaction
46299
+  (0.1ms) begin transaction
46300
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 9]]
46301
+  (0.1ms) commit transaction
46302
+  (0.1ms) begin transaction
46303
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 10]]
46304
+  (0.1ms) commit transaction
46305
+  (0.0ms) begin transaction
46306
+ SQL (0.5ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:28:23 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46307
+  (0.1ms) commit transaction
46308
+  (0.1ms) begin transaction
46309
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:28:23 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46310
+  (0.1ms) commit transaction
46311
+  (0.1ms) begin transaction
46312
+ SQL (79.9ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46313
+  (0.3ms) commit transaction
46314
+ User Load (0.3ms) SELECT "users".* FROM "users" LIMIT 25 OFFSET 0
46315
+ User Load (0.2ms) SELECT "users".* FROM "users" 
46316
+  (0.1ms) begin transaction
46317
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 11]]
46318
+  (0.1ms) commit transaction
46319
+  (0.1ms) begin transaction
46320
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 12]]
46321
+  (0.1ms) commit transaction
46322
+  (0.1ms) begin transaction
46323
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 13]]
46324
+  (0.1ms) commit transaction
46325
+  (0.1ms) begin transaction
46326
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:28:23 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46327
+  (0.1ms) commit transaction
46328
+  (0.1ms) begin transaction
46329
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:28:23 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46330
+  (0.1ms) commit transaction
46331
+  (0.1ms) begin transaction
46332
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46333
+  (0.1ms) commit transaction
46334
+ User Load (0.2ms) SELECT "users".* FROM "users"
46335
+ User Load (0.3ms) SELECT "users".* FROM "users" 
46336
+  (0.1ms) begin transaction
46337
+ SQL (0.2ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 14]]
46338
+  (0.1ms) commit transaction
46339
+  (0.1ms) begin transaction
46340
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 15]]
46341
+  (0.1ms) commit transaction
46342
+  (0.1ms) begin transaction
46343
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 16]]
46344
+  (0.1ms) commit transaction
46345
+  (0.1ms) begin transaction
46346
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:28:23 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46347
+  (0.1ms) commit transaction
46348
+  (0.1ms) begin transaction
46349
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:28:23 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46350
+  (0.0ms) commit transaction
46351
+  (0.0ms) begin transaction
46352
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46353
+  (0.1ms) commit transaction
46354
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE (("users"."dob" >= '1992-10-30 05:28:23.000000' AND "users"."dob" <= '2013-11-30 05:28:23.000000')) LIMIT 25 OFFSET 0
46355
+ User Load (0.2ms) SELECT "users".* FROM "users" 
46356
+  (0.1ms) begin transaction
46357
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 17]]
46358
+  (0.1ms) commit transaction
46359
+  (0.1ms) begin transaction
46360
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 18]]
46361
+  (0.1ms) commit transaction
46362
+  (0.1ms) begin transaction
46363
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 19]]
46364
+  (0.2ms) commit transaction
46365
+  (0.1ms) begin transaction
46366
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:28:23 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46367
+  (0.1ms) commit transaction
46368
+  (0.1ms) begin transaction
46369
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:28:23 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46370
+  (0.0ms) commit transaction
46371
+  (0.0ms) begin transaction
46372
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:28:23 UTC +00:00]]
46373
+  (0.0ms) commit transaction
46374
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."age" = 34 LIMIT 25 OFFSET 0
46375
+ Connecting to database specified by database.yml
46376
+  (3.3ms) select sqlite_version(*)
46377
+  (0.5ms) CREATE TABLE "gem_defined_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "age" integer)
46378
+  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "age" integer, "dob" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
46379
+  (0.2ms) CREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255))
46380
+  (0.3ms) CREATE TABLE "readerships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "book_id" integer) 
46381
+  (0.3ms) CREATE TABLE "authorships" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "book_id" integer)
46382
+  (0.3ms) CREATE TABLE "user_addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "street" varchar(255), "user_id" integer) 
46383
+ User Load (2.8ms) SELECT "users".* FROM "users"
46384
+  (0.1ms) begin transaction
46385
+ SQL (45.7ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:32:03 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46386
+  (0.1ms) commit transaction
46387
+  (0.1ms) begin transaction
46388
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:32:03 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46389
+  (0.1ms) commit transaction
46390
+  (0.1ms) begin transaction
46391
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46392
+  (0.1ms) commit transaction
46393
+ User Load (0.3ms) SELECT "users".* FROM "users" LIMIT 25 OFFSET 0
46394
+ User Load (0.2ms) SELECT "users".* FROM "users" 
46395
+  (0.1ms) begin transaction
46396
+ SQL (0.2ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
46397
+  (0.1ms) commit transaction
46398
+  (0.1ms) begin transaction
46399
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
46400
+  (0.1ms) commit transaction
46401
+  (0.1ms) begin transaction
46402
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
46403
+  (0.1ms) commit transaction
46404
+  (0.1ms) begin transaction
46405
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:32:03 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46406
+  (0.1ms) commit transaction
46407
+  (0.0ms) begin transaction
46408
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:32:03 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46409
+  (0.1ms) commit transaction
46410
+  (0.1ms) begin transaction
46411
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46412
+  (0.1ms) commit transaction
46413
+ User Load (0.2ms) SELECT "users".* FROM "users"
46414
+ User Load (0.2ms) SELECT "users".* FROM "users" 
46415
+  (0.1ms) begin transaction
46416
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
46417
+  (0.1ms) commit transaction
46418
+  (0.1ms) begin transaction
46419
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 5]]
46420
+  (0.1ms) commit transaction
46421
+  (0.1ms) begin transaction
46422
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 6]]
46423
+  (0.1ms) commit transaction
46424
+  (0.1ms) begin transaction
46425
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:32:03 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46426
+  (0.1ms) commit transaction
46427
+  (0.1ms) begin transaction
46428
+ SQL (0.5ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:32:03 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46429
+  (0.1ms) commit transaction
46430
+  (0.1ms) begin transaction
46431
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46432
+  (0.1ms) commit transaction
46433
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE (("users"."dob" >= '1992-10-30 05:32:03.000000' AND "users"."dob" <= '2013-11-30 05:32:03.000000')) LIMIT 25 OFFSET 0
46434
+ User Load (0.3ms) SELECT "users".* FROM "users" 
46435
+  (0.1ms) begin transaction
46436
+ SQL (0.2ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 7]]
46437
+  (0.1ms) commit transaction
46438
+  (0.1ms) begin transaction
46439
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 8]]
46440
+  (0.1ms) commit transaction
46441
+  (0.1ms) begin transaction
46442
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 9]]
46443
+  (0.1ms) commit transaction
46444
+  (0.1ms) begin transaction
46445
+ SQL (0.5ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:32:03 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46446
+  (0.1ms) commit transaction
46447
+  (0.1ms) begin transaction
46448
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:32:03 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46449
+  (0.1ms) commit transaction
46450
+  (0.1ms) begin transaction
46451
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", nil], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46452
+  (0.1ms) commit transaction
46453
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."age" = 34 LIMIT 25 OFFSET 0
46454
+ User Load (0.2ms) SELECT "users".* FROM "users" 
46455
+  (0.1ms) begin transaction
46456
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 10]]
46457
+  (0.1ms) commit transaction
46458
+  (0.0ms) begin transaction
46459
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 11]]
46460
+  (0.0ms) commit transaction
46461
+  (0.0ms) begin transaction
46462
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 12]]
46463
+  (0.1ms) commit transaction
46464
+  (0.1ms) begin transaction
46465
+ SQL (0.4ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:32:03 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46466
+  (0.2ms) commit transaction
46467
+  (0.1ms) begin transaction
46468
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:32:03 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46469
+  (0.1ms) commit transaction
46470
+  (0.0ms) begin transaction
46471
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Tue, 30 Oct 1979 05:32:03 UTC +00:00], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46472
+  (0.1ms) commit transaction
46473
+ User Load (0.2ms) SELECT "users".* FROM "users"
46474
+ User Load (0.2ms) SELECT "users".* FROM "users" 
46475
+  (0.0ms) begin transaction
46476
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 13]]
46477
+  (0.0ms) commit transaction
46478
+  (0.0ms) begin transaction
46479
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 14]]
46480
+  (0.0ms) commit transaction
46481
+  (0.0ms) begin transaction
46482
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 15]]
46483
+  (0.0ms) commit transaction
46484
+  (0.0ms) begin transaction
46485
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:32:03 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46486
+  (0.0ms) commit transaction
46487
+  (0.0ms) begin transaction
46488
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:32:03 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46489
+  (0.0ms) commit transaction
46490
+  (0.0ms) begin transaction
46491
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00], ["dob", Tue, 30 Oct 1979 05:32:03 UTC +00:00], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:32:03 UTC +00:00]]
46492
+  (0.0ms) commit transaction
46493
+  (0.1ms) SELECT AVG("users"."age") AS avg_id FROM "users"
46494
+  (0.1ms) SELECT AVG("users"."age") AS avg_id FROM "users" 
46495
+ User Load (0.1ms) SELECT "users".* FROM "users"
46496
+ User Load (0.3ms) SELECT "users".* FROM "users" 
46497
+  (0.1ms) begin transaction
46498
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 16]]
46499
+  (0.0ms) commit transaction
46500
+  (0.0ms) begin transaction
46501
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 17]]
46502
+  (0.0ms) commit transaction
46503
+  (0.0ms) begin transaction
46504
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 18]]
46505
+  (0.0ms) commit transaction
46506
+  (0.0ms) begin transaction
46507
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 10], ["created_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00], ["dob", Thu, 30 Oct 2003 05:32:06 UTC +00:00], ["name", "User#1"], ["updated_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00]]
46508
+  (0.0ms) commit transaction
46509
+  (0.0ms) begin transaction
46510
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 20], ["created_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00], ["dob", Sat, 30 Oct 1993 05:32:06 UTC +00:00], ["name", "User#2"], ["updated_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00]]
46511
+  (0.0ms) commit transaction
46512
+  (0.0ms) begin transaction
46513
+ SQL (0.2ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 34], ["created_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00], ["dob", Tue, 30 Oct 1979 05:32:06 UTC +00:00], ["name", "User#3"], ["updated_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00]]
46514
+  (0.1ms) commit transaction
46515
+ User Load (0.2ms) SELECT "users".* FROM "users"
46516
+  (0.1ms) begin transaction
46517
+ SQL (0.3ms) INSERT INTO "users" ("age", "created_at", "dob", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["age", 30], ["created_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00], ["dob", nil], ["name", "Jitu"], ["updated_at", Wed, 30 Oct 2013 05:32:06 UTC +00:00]]
46518
+  (0.1ms) commit transaction
46519
+  (0.0ms) begin transaction
46520
+ SQL (0.1ms) INSERT INTO "readerships" ("book_id", "user_id") VALUES (?, ?) [["book_id", nil], ["user_id", 22]]
46521
+  (0.0ms) commit transaction
46522
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 22 LIMIT 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-27 00:00:00.000000000 Z
12
+ date: 2013-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails