punching_bag 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/punch.rb +22 -37
- data/lib/punching_bag/version.rb +1 -1
- data/lib/tasks/punching_bag.rake +15 -6
- data/spec/internal/log/test.log +473 -0
- data/spec/models/punch_spec.rb +0 -12
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d21d475f8e6bab6ed6c1ad87a6173bff0c106bf
|
4
|
+
data.tar.gz: a0f6478508647cbfc15db9b36babe83846cc84c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17388f6730ae75872f8c87ea4f224f9ee27b2b2008fe0037a996bce96fbccb6d68ba7138aae6a537d60030ed66fb0786c4629045556b2e5fb4141744de7f7b09
|
7
|
+
data.tar.gz: ce9324f0eaf67e6ab02242ef9952a956a51a028a1d7a20433b0d33b07a7a9ae21fd19c888ad44ab2fec9e94071be52829a421d9705776ff46c827245c738095b
|
data/app/models/punch.rb
CHANGED
@@ -5,7 +5,7 @@ class Punch < ActiveRecord::Base
|
|
5
5
|
before_validation :set_defaults
|
6
6
|
validates :punchable_id, :punchable_type, :starts_at, :ends_at, :average_time, :hits, :presence => true
|
7
7
|
|
8
|
-
default_scope { order 'punches.average_time DESC' }
|
8
|
+
default_scope -> { order 'punches.average_time DESC' }
|
9
9
|
scope :combos, -> { where 'punches.hits > 1' }
|
10
10
|
scope :jabs, -> { where hits: 1 }
|
11
11
|
scope :before, ->(time = nil) { where('punches.ends_at <= ?', time) unless time.nil? }
|
@@ -13,6 +13,7 @@ class Punch < ActiveRecord::Base
|
|
13
13
|
scope :by_timeframe, ->(timeframe, time) {
|
14
14
|
where('punches.starts_at >= ? AND punches.ends_at <= ?', time.send("beginning_of_#{timeframe}"), time.send("end_of_#{timeframe}"))
|
15
15
|
}
|
16
|
+
scope :by_hour, ->(hour) { by_timeframe :hour, hour }
|
16
17
|
scope :by_day, ->(day) { by_timeframe :day, day }
|
17
18
|
scope :by_month, ->(month) { by_timeframe :month, month }
|
18
19
|
scope :by_year, ->(year) {
|
@@ -34,23 +35,29 @@ class Punch < ActiveRecord::Base
|
|
34
35
|
:year
|
35
36
|
elsif starts_at.day != ends_at.day
|
36
37
|
:month
|
37
|
-
elsif starts_at != ends_at
|
38
|
+
elsif starts_at.hour != ends_at.hour
|
38
39
|
:day
|
40
|
+
elsif starts_at != ends_at
|
41
|
+
:hour
|
39
42
|
else
|
40
43
|
:second
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
47
|
+
def hour_combo?
|
48
|
+
timeframe == :hour and not find_true_combo_for(:hour) == self
|
49
|
+
end
|
50
|
+
|
44
51
|
def day_combo?
|
45
|
-
timeframe == :day
|
52
|
+
timeframe == :day and not find_true_combo_for(:day) == self
|
46
53
|
end
|
47
54
|
|
48
55
|
def month_combo?
|
49
|
-
timeframe == :month
|
56
|
+
timeframe == :month and not find_true_combo_for(:month) == self
|
50
57
|
end
|
51
58
|
|
52
59
|
def year_combo?
|
53
|
-
timeframe == :year
|
60
|
+
timeframe == :year and not find_true_combo_for(:year) == self
|
54
61
|
end
|
55
62
|
|
56
63
|
def find_combo_for(timeframe)
|
@@ -58,6 +65,10 @@ class Punch < ActiveRecord::Base
|
|
58
65
|
punches.combos.first || punches.first
|
59
66
|
end
|
60
67
|
|
68
|
+
def find_true_combo_for(timeframe)
|
69
|
+
punchable.punches.combos.by_timeframe(timeframe, average_time).first
|
70
|
+
end
|
71
|
+
|
61
72
|
def combine_with(combo)
|
62
73
|
if combo && combo != self
|
63
74
|
combo.starts_at = starts_at if starts_at < combo.starts_at
|
@@ -69,6 +80,12 @@ class Punch < ActiveRecord::Base
|
|
69
80
|
combo
|
70
81
|
end
|
71
82
|
|
83
|
+
def combine_by_hour
|
84
|
+
unless hour_combo? || day_combo? || month_combo? || year_combo?
|
85
|
+
combine_with find_combo_for(:hour)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
72
89
|
def combine_by_day
|
73
90
|
unless day_combo? || month_combo? || year_combo?
|
74
91
|
combine_with find_combo_for(:day)
|
@@ -99,38 +116,6 @@ class Punch < ActiveRecord::Base
|
|
99
116
|
sums.values.inject(:+).to_f / sums.length
|
100
117
|
end
|
101
118
|
|
102
|
-
def self.combine_by_day(punchable)
|
103
|
-
combine_by :day, punchable
|
104
|
-
end
|
105
|
-
|
106
|
-
def self.combine_by_monthday(punchable)
|
107
|
-
combine_by :month, punchable
|
108
|
-
end
|
109
|
-
|
110
|
-
def self.combine_by_year(punchable)
|
111
|
-
combine_by :year, punchable
|
112
|
-
end
|
113
|
-
|
114
|
-
def self.combine_by(timeframe, punchable)
|
115
|
-
combo = nil
|
116
|
-
punches = punchable.punches.by_timeframe(timeframe)
|
117
|
-
|
118
|
-
if punches.length > 1
|
119
|
-
timestamps = punches.map{|p| [p.average_time.to_i] * p.hits}.flatten
|
120
|
-
|
121
|
-
combo = Punch.new(punchable: punchable)
|
122
|
-
combo.starts_at = punches.map(&:starts_at).min
|
123
|
-
combo.ends_at = punches.map(&:ends_at).max
|
124
|
-
combo.average_time = Time.at(timestamps.sum / timestamps.length).to_datetime
|
125
|
-
combo.hits = punches.map(&:hits).sum
|
126
|
-
combo.save!
|
127
|
-
|
128
|
-
punches.delete_all
|
129
|
-
end
|
130
|
-
|
131
|
-
combo
|
132
|
-
end
|
133
|
-
|
134
119
|
private
|
135
120
|
|
136
121
|
def set_defaults
|
data/lib/punching_bag/version.rb
CHANGED
data/lib/tasks/punching_bag.rake
CHANGED
@@ -1,30 +1,39 @@
|
|
1
1
|
namespace :punching_bag do
|
2
2
|
desc 'Combine old hit records together to improve performance'
|
3
|
-
task :combine, [:by_day_after, :by_month_after, :by_year_after] => [:environment] do |t, args|
|
4
|
-
args.with_defaults :by_day_after => 7, :by_month_after => 1, :by_year_after => 1
|
3
|
+
task :combine, [:by_hour_after, :by_day_after, :by_month_after, :by_year_after] => [:environment] do |t, args|
|
4
|
+
args.with_defaults :by_hour_after => 24, :by_day_after => 7, :by_month_after => 1, :by_year_after => 1
|
5
5
|
|
6
6
|
punchable_types = Punch.uniq.pluck(:punchable_type)
|
7
7
|
|
8
8
|
punchable_types.each do |punchable_type|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
punchable = punchable_type.constantize.find(punchable_id)
|
9
|
+
punchables = punchable_type.constantize.find(
|
10
|
+
Punch.uniq.where(punchable_type: punchable_type).pluck(:punchable_id)
|
11
|
+
)
|
13
12
|
|
13
|
+
punchables.each do |punchable|
|
14
14
|
# by_year
|
15
15
|
punchable.punches.before(args[:by_year_after].to_i.years.ago).each do |punch|
|
16
|
+
punch.reload # Dont use the cached version - we might have changed if we were the combo
|
16
17
|
punch.combine_by_year
|
17
18
|
end
|
18
19
|
|
19
20
|
# by_month
|
20
21
|
punchable.punches.before(args[:by_month_after].to_i.months.ago).each do |punch|
|
22
|
+
punch.reload # Dont use the cached version - we might have changed if we were the combo
|
21
23
|
punch.combine_by_month
|
22
24
|
end
|
23
25
|
|
24
26
|
# by_day
|
25
27
|
punchable.punches.before(args[:by_day_after].to_i.days.ago).each do |punch|
|
28
|
+
punch.reload # Dont use the cached version - we might have changed if we were the combo
|
26
29
|
punch.combine_by_day
|
27
30
|
end
|
31
|
+
|
32
|
+
# by_hour
|
33
|
+
punchable.punches.before(args[:by_hour_after].to_i.hours.ago).each do |punch|
|
34
|
+
punch.reload # Dont use the cached version - we might have changed if we were the combo
|
35
|
+
punch.combine_by_hour
|
36
|
+
end
|
28
37
|
end
|
29
38
|
end
|
30
39
|
end
|
data/spec/internal/log/test.log
CHANGED
@@ -19245,3 +19245,476 @@
|
|
19245
19245
|
[1m[35mSQL (0.5ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2014-07-25 15:30:13.942364"], ["ends_at", "2014-07-25 15:30:13.942364"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2014-07-25 15:30:13.942364"]]
|
19246
19246
|
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19247
19247
|
[1m[35m (0.3ms)[0m rollback transaction
|
19248
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
19249
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19250
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Ding, ding ding... ding. Ding. DING. DING! "], ["created_at", "2015-01-05 21:10:12.791459"], ["title", "Hector"], ["updated_at", "2015-01-05 21:10:12.791459"]]
|
19251
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19252
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19253
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19254
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "punches"[0m
|
19255
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19256
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Ding, ding ding... ding. Ding. DING. DING! "], ["created_at", "2015-01-05 21:10:12.801622"], ["title", "Hector"], ["updated_at", "2015-01-05 21:10:12.801622"]]
|
19257
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19258
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19259
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:12.812967"], ["ends_at", "2015-01-05 21:10:12.812967"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:12.812967"]]
|
19260
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19261
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "punches"
|
19262
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19263
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19264
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "punches"[0m
|
19265
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19266
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Ding, ding ding... ding. Ding. DING. DING! "], ["created_at", "2015-01-05 21:10:12.819502"], ["title", "Hector"], ["updated_at", "2015-01-05 21:10:12.819502"]]
|
19267
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19268
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19269
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:12.821544"], ["ends_at", "2015-01-05 21:10:12.821544"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:12.821544"]]
|
19270
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19271
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "punches"
|
19272
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19273
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19274
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
19275
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19276
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19277
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.828594"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.828594"]]
|
19278
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19279
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19280
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19281
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19282
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.832196"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.832196"]]
|
19283
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19284
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19285
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19286
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19287
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.835631"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.835631"]]
|
19288
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19289
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19290
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19291
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19292
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.839421"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.839421"]]
|
19293
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19294
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19295
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19296
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19297
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.843784"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.843784"]]
|
19298
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19299
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
19300
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19301
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19302
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.849548"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.849548"]]
|
19303
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19304
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19305
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19306
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19307
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.853911"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.853911"]]
|
19308
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19309
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19310
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19311
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19312
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.857650"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.857650"]]
|
19313
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19314
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
19315
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19316
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19317
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.861064"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.861064"]]
|
19318
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19319
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19320
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19321
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19322
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.864527"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.864527"]]
|
19323
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19324
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19325
|
+
[1m[35m (0.0ms)[0m begin transaction
|
19326
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19327
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.868230"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.868230"]]
|
19328
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19329
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19330
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19331
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19332
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.872305"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.872305"]]
|
19333
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19334
|
+
[1m[36mPunch Load (0.2ms)[0m [1mSELECT "punches".* FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? AND (punches.hits > 1) AND (punches.starts_at >= '2015-01-05 00:00:00.000000' AND punches.ends_at <= '2015-01-05 23:59:59.999999') ORDER BY punches.average_time DESC LIMIT 1[0m [["punchable_id", 1], ["punchable_type", "Article"]]
|
19335
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19336
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19337
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19338
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.889074"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.889074"]]
|
19339
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19340
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19341
|
+
[1m[35m (0.0ms)[0m begin transaction
|
19342
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19343
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.892747"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.892747"]]
|
19344
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19345
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19346
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19347
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19348
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.896610"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.896610"]]
|
19349
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19350
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19351
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19352
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19353
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.900226"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.900226"]]
|
19354
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19355
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
19356
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19357
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19358
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.905685"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.905685"]]
|
19359
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19360
|
+
[1m[36mPunch Load (0.3ms)[0m [1mSELECT "punches".* FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? AND (punches.hits > 1) AND (punches.starts_at >= '2015-01-01 00:00:00.000000' AND punches.ends_at <= '2015-01-31 23:59:59.999999') ORDER BY punches.average_time DESC LIMIT 1[0m [["punchable_id", 1], ["punchable_type", "Article"]]
|
19361
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19362
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19363
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19364
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.913121"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.913121"]]
|
19365
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19366
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19367
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19368
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19369
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.917172"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.917172"]]
|
19370
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19371
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19372
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19373
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19374
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.920777"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.920777"]]
|
19375
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19376
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
19377
|
+
[1m[35m (0.0ms)[0m begin transaction
|
19378
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19379
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.924338"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.924338"]]
|
19380
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19381
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19382
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19383
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19384
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.928057"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.928057"]]
|
19385
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19386
|
+
[1m[36mPunch Load (0.3ms)[0m [1mSELECT "punches".* FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? AND (punches.hits > 1) AND (punches.starts_at >= '2015-01-01 00:00:00.000000' AND punches.ends_at <= '2015-12-31 23:59:59.999999') ORDER BY punches.average_time DESC LIMIT 1[0m [["punchable_id", 1], ["punchable_type", "Article"]]
|
19387
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19388
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19389
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19390
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.935478"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.935478"]]
|
19391
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19392
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19393
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:12.937733"], ["ends_at", "2015-01-05 21:10:12.937733"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:12.937733"]]
|
19394
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19395
|
+
[1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "punches"
|
19396
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "punches"[0m
|
19397
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19398
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19399
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19400
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.944040"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.944040"]]
|
19401
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19402
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19403
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 10:00:00.000000"], ["ends_at", "2015-01-05 10:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 10:00:00.000000"]]
|
19404
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19405
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19406
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-12 08:00:00.000000"], ["ends_at", "2015-01-12 08:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-12 08:00:00.000000"]]
|
19407
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19408
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19409
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 09:00:00.000000"], ["ends_at", "2015-01-05 09:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19410
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19411
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19412
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "punches" SET "average_time" = ?, "hits" = ?, "starts_at" = ? WHERE "punches"."id" = 1[0m [["average_time", "2015-01-05 09:30:00.000000"], ["hits", 2], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19413
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19414
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19415
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "punches" WHERE "punches"."id" = ? [["id", 3]]
|
19416
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19417
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
19418
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19419
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19420
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.956043"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.956043"]]
|
19421
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19422
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19423
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 10:00:00.000000"], ["ends_at", "2015-01-05 10:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 10:00:00.000000"]]
|
19424
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19425
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19426
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-12 08:00:00.000000"], ["ends_at", "2015-01-12 08:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-12 08:00:00.000000"]]
|
19427
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19428
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19429
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 09:00:00.000000"], ["ends_at", "2015-01-05 09:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19430
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19431
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19432
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "punches" SET "average_time" = ?, "hits" = ?, "starts_at" = ? WHERE "punches"."id" = 1[0m [["average_time", "2015-01-05 09:30:00.000000"], ["hits", 2], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19433
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19434
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19435
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "punches" WHERE "punches"."id" = ? [["id", 3]]
|
19436
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19437
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
19438
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19439
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19440
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.969076"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.969076"]]
|
19441
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19442
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19443
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 10:00:00.000000"], ["ends_at", "2015-01-05 10:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 10:00:00.000000"]]
|
19444
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19445
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19446
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-12 08:00:00.000000"], ["ends_at", "2015-01-12 08:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-12 08:00:00.000000"]]
|
19447
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19448
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19449
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 09:00:00.000000"], ["ends_at", "2015-01-05 09:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19450
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19451
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19452
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "punches" SET "average_time" = ?, "hits" = ?, "starts_at" = ? WHERE "punches"."id" = 1[0m [["average_time", "2015-01-05 09:30:00.000000"], ["hits", 2], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19453
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19454
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19455
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "punches" WHERE "punches"."id" = ? [["id", 3]]
|
19456
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19457
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19458
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19459
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19460
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.980612"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.980612"]]
|
19461
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19462
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19463
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 10:00:00.000000"], ["ends_at", "2015-01-05 10:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 10:00:00.000000"]]
|
19464
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19465
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19466
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-12 08:00:00.000000"], ["ends_at", "2015-01-12 08:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-12 08:00:00.000000"]]
|
19467
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19468
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19469
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 09:00:00.000000"], ["ends_at", "2015-01-05 09:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19470
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19471
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19472
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "punches" SET "average_time" = ?, "hits" = ?, "starts_at" = ? WHERE "punches"."id" = 1[0m [["average_time", "2015-01-05 09:30:00.000000"], ["hits", 2], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19473
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19474
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19475
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "punches" WHERE "punches"."id" = ? [["id", 3]]
|
19476
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19477
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19478
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19479
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19480
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:12.991110"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:12.991110"]]
|
19481
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19482
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19483
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 10:00:00.000000"], ["ends_at", "2015-01-05 10:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 10:00:00.000000"]]
|
19484
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19485
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19486
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-12 08:00:00.000000"], ["ends_at", "2015-01-12 08:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-12 08:00:00.000000"]]
|
19487
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19488
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19489
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 09:00:00.000000"], ["ends_at", "2015-01-05 09:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19490
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19491
|
+
[1m[35mPunch Load (0.2ms)[0m SELECT "punches".* FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? AND (punches.starts_at >= '2015-01-05 00:00:00.000000' AND punches.ends_at <= '2015-01-05 23:59:59.999999') AND (id != 3) AND (punches.hits > 1) ORDER BY punches.average_time DESC LIMIT 1 [["punchable_id", 1], ["punchable_type", "Article"]]
|
19492
|
+
[1m[36mPunch Load (0.2ms)[0m [1mSELECT "punches".* FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? AND (punches.starts_at >= '2015-01-05 00:00:00.000000' AND punches.ends_at <= '2015-01-05 23:59:59.999999') AND (id != 3) ORDER BY punches.average_time DESC LIMIT 1[0m [["punchable_id", 1], ["punchable_type", "Article"]]
|
19493
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19494
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19495
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19496
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "I know, I just call her Annabelle cause she's shaped like a... she's the belle of the ball!"], ["created_at", "2015-01-05 21:10:13.005534"], ["title", "Bluths"], ["updated_at", "2015-01-05 21:10:13.005534"]]
|
19497
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19498
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19499
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 10:00:00.000000"], ["ends_at", "2015-01-05 10:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 10:00:00.000000"]]
|
19500
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19501
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19502
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-12 08:00:00.000000"], ["ends_at", "2015-01-12 08:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-12 08:00:00.000000"]]
|
19503
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19504
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19505
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 09:00:00.000000"], ["ends_at", "2015-01-05 09:00:00.000000"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 09:00:00.000000"]]
|
19506
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19507
|
+
[1m[35mPunch Load (0.1ms)[0m SELECT "punches".* FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? AND (punches.starts_at >= '2015-01-05 00:00:00.000000' AND punches.ends_at <= '2015-01-05 23:59:59.999999') AND (id != 3) AND (punches.hits > 1) ORDER BY punches.average_time DESC LIMIT 1 [["punchable_id", 1], ["punchable_type", "Article"]]
|
19508
|
+
[1m[36mPunch Load (0.1ms)[0m [1mSELECT "punches".* FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? AND (punches.starts_at >= '2015-01-05 00:00:00.000000' AND punches.ends_at <= '2015-01-05 23:59:59.999999') AND (id != 3) ORDER BY punches.average_time DESC LIMIT 1[0m [["punchable_id", 1], ["punchable_type", "Article"]]
|
19509
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19510
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19511
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19512
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.018738"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.018738"]]
|
19513
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19514
|
+
[1m[36m (0.2ms)[0m [1mSELECT SUM("punches"."hits") AS sum_id FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ?[0m [["punchable_id", 1], ["punchable_type", "Article"]]
|
19515
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19516
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19517
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19518
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.025317"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.025317"]]
|
19519
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19520
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19521
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.028874"], ["ends_at", "2015-01-05 21:10:13.028874"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.028874"]]
|
19522
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19523
|
+
[1m[35m (0.1ms)[0m SELECT SUM("punches"."hits") AS sum_id FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? [["punchable_id", 1], ["punchable_type", "Article"]]
|
19524
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
19525
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19526
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19527
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.035790"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.035790"]]
|
19528
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19529
|
+
[1m[35m (0.1ms)[0m SELECT SUM("punches"."hits") AS sum_id FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? [["punchable_id", 1], ["punchable_type", "Article"]]
|
19530
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19531
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.039769"], ["ends_at", "2015-01-05 21:10:13.039769"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.039769"]]
|
19532
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19533
|
+
[1m[35m (0.1ms)[0m SELECT SUM("punches"."hits") AS sum_id FROM "punches" WHERE "punches"."punchable_id" = ? AND "punches"."punchable_type" = ? [["punchable_id", 1], ["punchable_type", "Article"]]
|
19534
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19535
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19536
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19537
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.044801"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.044801"]]
|
19538
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19539
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19540
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.046990"], ["ends_at", "2015-01-05 21:10:13.046990"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.046990"]]
|
19541
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19542
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19543
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.049236"], ["ends_at", "2015-01-05 21:10:13.049236"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.049236"]]
|
19544
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19545
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19546
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.051092"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.051092"]]
|
19547
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19548
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19549
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.052775"], ["ends_at", "2015-01-05 21:10:13.052775"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.052775"]]
|
19550
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19551
|
+
[1m[35mArticle Load (0.4ms)[0m SELECT "articles".* FROM "articles" INNER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "punches"."punchable_type", "punches"."punchable_id", "articles"."id" ORDER BY SUM(punches.hits) DESC LIMIT 5
|
19552
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
19553
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19554
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19555
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.068194"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.068194"]]
|
19556
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19557
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19558
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.070325"], ["ends_at", "2015-01-05 21:10:13.070325"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.070325"]]
|
19559
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19560
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19561
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.072563"], ["ends_at", "2015-01-05 21:10:13.072563"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.072563"]]
|
19562
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19563
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19564
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.074389"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.074389"]]
|
19565
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19566
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19567
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.076117"], ["ends_at", "2015-01-05 21:10:13.076117"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.076117"]]
|
19568
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19569
|
+
[1m[35mArticle Load (0.3ms)[0m SELECT "articles".* FROM "articles" INNER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "punches"."punchable_type", "punches"."punchable_id", "articles"."id" ORDER BY SUM(punches.hits) DESC LIMIT 5
|
19570
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19571
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19572
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19573
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.080702"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.080702"]]
|
19574
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19575
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19576
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.082907"], ["ends_at", "2015-01-05 21:10:13.082907"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.082907"]]
|
19577
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19578
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19579
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.085236"], ["ends_at", "2015-01-05 21:10:13.085236"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.085236"]]
|
19580
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19581
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19582
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.087614"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.087614"]]
|
19583
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19584
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19585
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.090420"], ["ends_at", "2015-01-05 21:10:13.090420"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.090420"]]
|
19586
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19587
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19588
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "American Apparel aute Banksy officia ugh."], ["created_at", "2015-01-05 21:10:13.093130"], ["title", "Hipsters"], ["updated_at", "2015-01-05 21:10:13.093130"]]
|
19589
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19590
|
+
[1m[36mArticle Load (0.3ms)[0m [1mSELECT "articles".* FROM "articles" INNER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "punches"."punchable_type", "punches"."punchable_id", "articles"."id" ORDER BY SUM(punches.hits) DESC LIMIT 5[0m
|
19591
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19592
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19593
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19594
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.098019"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.098019"]]
|
19595
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19596
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19597
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.099855"], ["ends_at", "2015-01-05 21:10:13.099855"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.099855"]]
|
19598
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19599
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19600
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.101765"], ["ends_at", "2015-01-05 21:10:13.101765"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.101765"]]
|
19601
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19602
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19603
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.103346"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.103346"]]
|
19604
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19605
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19606
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.104908"], ["ends_at", "2015-01-05 21:10:13.104908"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.104908"]]
|
19607
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19608
|
+
[1m[36mArticle Load (0.2ms)[0m [1mSELECT "articles".* FROM "articles" INNER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "punches"."punchable_type", "punches"."punchable_id", "articles"."id" ORDER BY SUM(punches.hits) DESC LIMIT 1[0m
|
19609
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19610
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
19611
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19612
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.109116"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.109116"]]
|
19613
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19614
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19615
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.111183"], ["ends_at", "2015-01-05 21:10:13.111183"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.111183"]]
|
19616
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19617
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19618
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.113068"], ["ends_at", "2015-01-05 21:10:13.113068"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.113068"]]
|
19619
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19620
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19621
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.114701"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.114701"]]
|
19622
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19623
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19624
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.116246"], ["ends_at", "2015-01-05 21:10:13.116246"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.116246"]]
|
19625
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19626
|
+
[1m[36mArticle Load (0.3ms)[0m [1mSELECT "articles".* FROM "articles" INNER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "punches"."punchable_type", "punches"."punchable_id", "articles"."id" ORDER BY SUM(punches.hits) DESC LIMIT 1 OFFSET 1[0m
|
19627
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
19628
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19629
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19630
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.123079"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.123079"]]
|
19631
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19632
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19633
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.125303"], ["ends_at", "2015-01-05 21:10:13.125303"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.125303"]]
|
19634
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19635
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19636
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.127636"], ["ends_at", "2015-01-05 21:10:13.127636"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.127636"]]
|
19637
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19638
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19639
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.129273"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.129273"]]
|
19640
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19641
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19642
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.130875"], ["ends_at", "2015-01-05 21:10:13.130875"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.130875"]]
|
19643
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19644
|
+
[1m[36mArticle Load (0.2ms)[0m [1mSELECT "articles".* FROM "articles" LEFT OUTER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "articles"."id" ORDER BY SUM(punches.hits) DESC[0m
|
19645
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
19646
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
19647
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19648
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.134779"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.134779"]]
|
19649
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19650
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19651
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.136632"], ["ends_at", "2015-01-05 21:10:13.136632"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.136632"]]
|
19652
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19653
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19654
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.139719"], ["ends_at", "2015-01-05 21:10:13.139719"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.139719"]]
|
19655
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19656
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19657
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.142356"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.142356"]]
|
19658
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19659
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19660
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.144794"], ["ends_at", "2015-01-05 21:10:13.144794"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.144794"]]
|
19661
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19662
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19663
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "American Apparel aute Banksy officia ugh."], ["created_at", "2015-01-05 21:10:13.147457"], ["title", "Hipsters"], ["updated_at", "2015-01-05 21:10:13.147457"]]
|
19664
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19665
|
+
[1m[35mArticle Load (0.3ms)[0m SELECT "articles".* FROM "articles" LEFT OUTER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "articles"."id" ORDER BY SUM(punches.hits) DESC
|
19666
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
19667
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19668
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19669
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.154052"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.154052"]]
|
19670
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19671
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19672
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.157095"], ["ends_at", "2015-01-05 21:10:13.157095"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.157095"]]
|
19673
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19674
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19675
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.159737"], ["ends_at", "2015-01-05 21:10:13.159737"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.159737"]]
|
19676
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19677
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19678
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.161826"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.161826"]]
|
19679
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19680
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19681
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.163549"], ["ends_at", "2015-01-05 21:10:13.163549"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.163549"]]
|
19682
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19683
|
+
[1m[35mArticle Load (0.2ms)[0m SELECT "articles".* FROM "articles" LEFT OUTER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "articles"."id" ORDER BY SUM(punches.hits) DESC
|
19684
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19685
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19686
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19687
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.167447"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.167447"]]
|
19688
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19689
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19690
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.169310"], ["ends_at", "2015-01-05 21:10:13.169310"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.169310"]]
|
19691
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19692
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
19693
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.171292"], ["ends_at", "2015-01-05 21:10:13.171292"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.171292"]]
|
19694
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19695
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
19696
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.172871"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.172871"]]
|
19697
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19698
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19699
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.174512"], ["ends_at", "2015-01-05 21:10:13.174512"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.174512"]]
|
19700
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19701
|
+
[1m[35mArticle Load (0.2ms)[0m SELECT "articles".* FROM "articles" LEFT OUTER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "articles"."id" ORDER BY SUM(punches.hits) DESC LIMIT 1
|
19702
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
19703
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19704
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19705
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "Lebowski ipsum over the line! Dolor sit amet, consectetur adipiscing elit praesent ac."], ["created_at", "2015-01-05 21:10:13.178676"], ["title", "Lebowski"], ["updated_at", "2015-01-05 21:10:13.178676"]]
|
19706
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19707
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19708
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?)[0m [["average_time", "2015-01-05 21:10:13.181028"], ["ends_at", "2015-01-05 21:10:13.181028"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.181028"]]
|
19709
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19710
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19711
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.183769"], ["ends_at", "2015-01-05 21:10:13.183769"], ["punchable_id", 1], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.183769"]]
|
19712
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19713
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
19714
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Bacon ipsum dolor sit amet turkey short ribs tri-tip"], ["created_at", "2015-01-05 21:10:13.185866"], ["title", "Bacon"], ["updated_at", "2015-01-05 21:10:13.185866"]]
|
19715
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
19716
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
19717
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "punches" ("average_time", "ends_at", "punchable_id", "punchable_type", "starts_at") VALUES (?, ?, ?, ?, ?) [["average_time", "2015-01-05 21:10:13.188057"], ["ends_at", "2015-01-05 21:10:13.188057"], ["punchable_id", 2], ["punchable_type", "Article"], ["starts_at", "2015-01-05 21:10:13.188057"]]
|
19718
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
19719
|
+
[1m[35mArticle Load (0.2ms)[0m SELECT "articles".* FROM "articles" LEFT OUTER JOIN "punches" ON "punches"."punchable_id" = "articles"."id" AND "punches"."punchable_type" = 'Article' GROUP BY "articles"."id" ORDER BY SUM(punches.hits) DESC LIMIT 1 OFFSET 1
|
19720
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
data/spec/models/punch_spec.rb
CHANGED
@@ -104,16 +104,4 @@ describe Punch do
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
107
|
-
|
108
|
-
describe '.combine_by' do
|
109
|
-
let(:combine_by) { -> { Punch.combine_by(:day, article) } }
|
110
|
-
|
111
|
-
context 'with one punch' do
|
112
|
-
let!(:punch) { Punch.create punchable: article }
|
113
|
-
|
114
|
-
it 'does nothing' do
|
115
|
-
expect { combine_by.call }.to_not change { punch }
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: punching_bag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -174,4 +174,3 @@ test_files:
|
|
174
174
|
- spec/internal/config/database.yml
|
175
175
|
- spec/internal/app/models/article.rb
|
176
176
|
- spec/internal/log/test.log
|
177
|
-
has_rdoc:
|