multi_bit_field 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -63,6 +63,8 @@ person.counter.to_s(2)
63
63
 
64
64
  We also provide convenient methods for resetting and incrementing fields. These methods require active-record and active-relation since they use the "update_attributes" and "update_all" methods.
65
65
 
66
+ When only the columnn name is supplied, it will increment or reset all of the fields.
67
+
66
68
  ```ruby
67
69
  peron.reset(:counter, :daily)
68
70
  person.daily
@@ -70,10 +72,22 @@ person.daily
70
72
  person.monthly
71
73
  => 4
72
74
 
75
+ person.reset(:counter)
76
+ person.daily
77
+ => 0
78
+ person.monthly
79
+ => 0
80
+
73
81
  person.increment(:counter, :daily)
74
82
  person.daily
75
83
  => 1
76
84
 
85
+ person.increment(:counter)
86
+ person.daily
87
+ => 2
88
+ person.monthly
89
+ => 1
90
+
77
91
  person.reset(:counter, :daily, :monthly)
78
92
  person.daily
79
93
  => 0
@@ -101,6 +115,14 @@ By the way, these methods all work with your chainable active-relation query met
101
115
  Person.where(:daily => 0).increment_bitfield(:counter, :daily)
102
116
  ```
103
117
 
118
+ We also support some cool counting features -- be sure to admire the nice clean SQL:
119
+
120
+ ```ruby
121
+ Person.count_by(:counter, :monthly)
122
+ (0.4ms) SELECT count(id) as daily_count, (counter & 31744)/1024 as daily FROM "people" GROUP BY daily
123
+ => [{"daily_count" => 2, "daily" => 5}, {"daily_count" => 3, "daily" => 1}]
124
+ ```
125
+
104
126
  One limitation you should be aware of:
105
127
 
106
128
  Since this technique pins the counters/limits to specific bits, you will need to plan the size of integer you intend to store in each field. For instance, if you need numbers 0-7, you can store that in 3 bits, if you need 0-31, you'll need 5 bits, etc.
@@ -50,6 +50,19 @@ module MultiBitField
50
50
  @@bitfields[column_name].values.sum.count
51
51
  end
52
52
 
53
+ # Returns the field names for the bitfield column
54
+ #
55
+ # +bitfields
56
+ #
57
+ # @example
58
+ # user.bitfields :counter
59
+ #
60
+ # @param [ Symbol ] column_name column name that stores the bitfield integer
61
+ #
62
+ def bitfields column_name
63
+ @@bitfields[column_name].keys
64
+ end
65
+
53
66
  # Returns a "reset mask" for a list of fields
54
67
  #
55
68
  # +reset_mask_for :fields
@@ -60,6 +73,7 @@ module MultiBitField
60
73
  # @param [ Symbol ] column name of the column these fields are in
61
74
  # @param [ Symbol ] field(s) name of the field(s) for the mask
62
75
  def reset_mask_for column_name, *fields
76
+ fields = bitfields if fields.empty?
63
77
  fields.inject("1" * bitfield_size(column_name)) do |mask, field_name|
64
78
  column = @@bitfields[column_name]
65
79
  raise ArgumentError, "Unknown column for bitfield: #{column_name}" if column.nil?
@@ -80,6 +94,7 @@ module MultiBitField
80
94
  # @param [ Symbol ] column name of the column these fields are in
81
95
  # @param [ Symbol ] field(s) name of the field(s) for the mask
82
96
  def increment_mask_for column_name, *fields
97
+ fields = bitfields if fields.empty?
83
98
  fields.inject("0" * bitfield_size(column_name)) do |mask, field_name|
84
99
  column = @@bitfields[column_name]
85
100
  raise ArgumentError, "Unknown column for bitfield: #{column_name}" if column.nil?
@@ -90,6 +105,27 @@ module MultiBitField
90
105
  end.to_i(2)
91
106
  end
92
107
 
108
+ # Returns an "only mask" for a list of fields
109
+ #
110
+ # +only_mask_for :fields
111
+ #
112
+ # @example
113
+ # user.only_mask_for :field
114
+ #
115
+ # @param [ Symbol ] column name of the column these fields are in
116
+ # @param [ Symbol ] field(s) name of the field(s) for the mask
117
+ def only_mask_for column_name, *fields
118
+ fields = bitfields if fields.empty?
119
+ fields.inject("0" * bitfield_size(column_name)) do |mask, field_name|
120
+ column = @@bitfields[column_name]
121
+ raise ArgumentError, "Unknown column for bitfield: #{column_name}" if column.nil?
122
+ raise ArugmentError, "Unknown field: #{field_name} for column #{column_name}" if column[field_name].nil?
123
+ range = column[field_name]
124
+ mask[range] = "1" * range.count
125
+ mask
126
+ end.to_i(2)
127
+ end
128
+
93
129
  # Sets one or more bitfields to 0 within a column
94
130
  #
95
131
  # +reset_bitfield :column, :fields
@@ -120,6 +156,25 @@ module MultiBitField
120
156
  end
121
157
  alias :increment_bitfield :increment_bitfields
122
158
 
159
+ # Counts resources grouped by a bitfield
160
+ #
161
+ # +count_by :column, :fields
162
+ #
163
+ # @example
164
+ # user.count_by :counter, :monthly
165
+ #
166
+ # @param [ Symbol ] column name of the column these fields are in
167
+ # @param [ Symbol ] field(s) name of the field(s) to reset
168
+ def count_by column_name, field
169
+ inc = increment_mask_for column_name, field
170
+ only = only_mask_for column_name, field
171
+ # Create super-special-bitfield-grouping-query w/ AREL
172
+ sql = arel_table.
173
+ project("count(#{primary_key}) as #{field}_count, (#{column_name} & #{only})/#{inc} as #{field}").
174
+ group(field).to_sql
175
+ connection.send :select, sql, 'AREL' # Execute the query
176
+ end
177
+
123
178
  private
124
179
 
125
180
  def bitfield_setup! column, fields
@@ -128,7 +183,7 @@ module MultiBitField
128
183
  else
129
184
  @@bitfields = { column => fields }
130
185
  end
131
- end
186
+ end
132
187
  end
133
188
 
134
189
  module InstanceMethods
@@ -190,8 +245,7 @@ module MultiBitField
190
245
 
191
246
  # replace with integer value
192
247
  self[column] = temp_field.to_i(2)
193
- end
194
-
248
+ end
195
249
  end
196
250
 
197
251
  def self.included(receiver)
@@ -1,3 +1,3 @@
1
1
  module MultiBitField
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
Binary file
Binary file
@@ -978,3 +978,753 @@
978
978
   (0.0ms) begin transaction
979
979
  SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 119]]
980
980
   (1.4ms) commit transaction
981
+  (0.1ms) begin transaction
982
+ SQL (126.8ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
983
+  (22.2ms) commit transaction
984
+  (0.1ms) begin transaction
985
+  (0.4ms) UPDATE "people" SET "birthday" = 240, "updated_at" = '2012-03-12 01:06:59.630366' WHERE "people"."id" = 120
986
+  (1.3ms) commit transaction
987
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 120]]
988
+ Person Load (0.2ms) SELECT "people".* FROM "people"
989
+  (0.0ms) begin transaction
990
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 120]]
991
+  (1.9ms) commit transaction
992
+  (0.1ms) begin transaction
993
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 409], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
994
+  (1.3ms) commit transaction
995
+  (0.0ms) begin transaction
996
+  (0.5ms) UPDATE "people" SET "birthday" = 25, "updated_at" = '2012-03-12 01:06:59.650114' WHERE "people"."id" = 121
997
+  (1.2ms) commit transaction
998
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 121]]
999
+ Person Load (0.5ms) SELECT "people".* FROM "people" 
1000
+  (0.1ms) begin transaction
1001
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 121]]
1002
+  (1.8ms) commit transaction
1003
+  (0.1ms) begin transaction
1004
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1005
+  (1.8ms) commit transaction
1006
+  (0.1ms) begin transaction
1007
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1008
+  (1.2ms) commit transaction
1009
+ SQL (1.5ms) UPDATE "people" SET birthday = birthday + 32
1010
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1011
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1012
+  (0.0ms) begin transaction
1013
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 122]]
1014
+  (1.2ms) commit transaction
1015
+  (0.0ms) begin transaction
1016
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 123]]
1017
+  (1.3ms) commit transaction
1018
+  (0.1ms) begin transaction
1019
+ SQL (1.0ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1020
+  (2.0ms) commit transaction
1021
+  (0.1ms) begin transaction
1022
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1023
+  (2.0ms) commit transaction
1024
+ SQL (1.4ms) UPDATE "people" SET birthday = birthday + 32
1025
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1026
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1027
+  (0.0ms) begin transaction
1028
+ SQL (0.5ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 124]]
1029
+  (1.3ms) commit transaction
1030
+  (0.1ms) begin transaction
1031
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 125]]
1032
+  (1.2ms) commit transaction
1033
+  (0.1ms) begin transaction
1034
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1035
+  (1.3ms) commit transaction
1036
+  (0.0ms) begin transaction
1037
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1038
+  (1.5ms) commit transaction
1039
+ SQL (1.5ms) UPDATE "people" SET birthday = birthday & 31
1040
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1041
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1042
+  (0.0ms) begin transaction
1043
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 126]]
1044
+  (1.2ms) commit transaction
1045
+  (0.0ms) begin transaction
1046
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 127]]
1047
+  (1.4ms) commit transaction
1048
+  (0.1ms) begin transaction
1049
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1050
+  (1.3ms) commit transaction
1051
+  (0.0ms) begin transaction
1052
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1053
+  (1.2ms) commit transaction
1054
+ SQL (1.4ms) UPDATE "people" SET birthday = birthday & 31
1055
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1056
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1057
+  (0.0ms) begin transaction
1058
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 128]]
1059
+  (1.2ms) commit transaction
1060
+  (0.1ms) begin transaction
1061
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 129]]
1062
+  (2.0ms) commit transaction
1063
+  (0.1ms) begin transaction
1064
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 01:06:59 UTC +00:00]]
1065
+  (1.3ms) commit transaction
1066
+  (0.1ms) begin transaction
1067
+  (0.4ms) UPDATE "people" SET "birthday" = 0, "updated_at" = '2012-03-12 01:06:59.728641' WHERE "people"."id" = 130
1068
+  (1.2ms) commit transaction
1069
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 130]]
1070
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1071
+  (0.0ms) begin transaction
1072
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 130]]
1073
+  (1.2ms) commit transaction
1074
+  (0.1ms) begin transaction
1075
+ SQL (34.9ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1076
+  (1.6ms) commit transaction
1077
+  (0.1ms) begin transaction
1078
+  (0.4ms) UPDATE "people" SET "birthday" = 240, "updated_at" = '2012-03-12 03:32:52.747143' WHERE "people"."id" = 131
1079
+  (1.5ms) commit transaction
1080
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 131]]
1081
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1082
+  (0.1ms) begin transaction
1083
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 131]]
1084
+  (1.6ms) commit transaction
1085
+  (0.1ms) begin transaction
1086
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 409], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1087
+  (1.6ms) commit transaction
1088
+  (0.1ms) begin transaction
1089
+  (0.4ms) UPDATE "people" SET "birthday" = 25, "updated_at" = '2012-03-12 03:32:52.768064' WHERE "people"."id" = 132
1090
+  (1.5ms) commit transaction
1091
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 132]]
1092
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1093
+  (0.0ms) begin transaction
1094
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 132]]
1095
+  (1.2ms) commit transaction
1096
+  (0.1ms) begin transaction
1097
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1098
+  (1.4ms) commit transaction
1099
+  (0.1ms) begin transaction
1100
+ SQL (0.9ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1101
+  (1.5ms) commit transaction
1102
+ SQL (1.6ms) UPDATE "people" SET birthday = birthday + 32
1103
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1104
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1105
+  (0.0ms) begin transaction
1106
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 133]]
1107
+  (1.4ms) commit transaction
1108
+  (0.1ms) begin transaction
1109
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 134]]
1110
+  (1.2ms) commit transaction
1111
+  (0.1ms) begin transaction
1112
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1113
+  (1.4ms) commit transaction
1114
+  (0.1ms) begin transaction
1115
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1116
+  (1.5ms) commit transaction
1117
+ SQL (1.5ms) UPDATE "people" SET birthday = birthday + 32
1118
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1119
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1120
+  (0.0ms) begin transaction
1121
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 135]]
1122
+  (1.3ms) commit transaction
1123
+  (0.3ms) begin transaction
1124
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 136]]
1125
+  (2.1ms) commit transaction
1126
+  (0.1ms) begin transaction
1127
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1128
+  (1.3ms) commit transaction
1129
+  (0.0ms) begin transaction
1130
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1131
+  (1.3ms) commit transaction
1132
+ SQL (5.8ms) UPDATE "people" SET birthday = birthday & 31
1133
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1134
+ Person Load (1.1ms) SELECT "people".* FROM "people" 
1135
+  (0.1ms) begin transaction
1136
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 137]]
1137
+  (2.3ms) commit transaction
1138
+  (0.1ms) begin transaction
1139
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 138]]
1140
+  (7.9ms) commit transaction
1141
+  (0.1ms) begin transaction
1142
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1143
+  (1.7ms) commit transaction
1144
+  (0.1ms) begin transaction
1145
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1146
+  (1.4ms) commit transaction
1147
+ SQL (1.9ms) UPDATE "people" SET birthday = birthday & 31
1148
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1149
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1150
+  (0.0ms) begin transaction
1151
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 139]]
1152
+  (1.3ms) commit transaction
1153
+  (0.1ms) begin transaction
1154
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 140]]
1155
+  (1.5ms) commit transaction
1156
+  (0.1ms) begin transaction
1157
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:32:52 UTC +00:00]]
1158
+  (2.2ms) commit transaction
1159
+  (0.1ms) begin transaction
1160
+  (0.3ms) UPDATE "people" SET "birthday" = 0, "updated_at" = '2012-03-12 03:32:52.860179' WHERE "people"."id" = 141
1161
+  (1.6ms) commit transaction
1162
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 141]]
1163
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1164
+  (0.0ms) begin transaction
1165
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 141]]
1166
+  (1.5ms) commit transaction
1167
+  (0.1ms) begin transaction
1168
+ SQL (16.9ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 205], ["created_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00]]
1169
+  (2.8ms) commit transaction
1170
+  (0.1ms) begin transaction
1171
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 156], ["created_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00]]
1172
+  (1.4ms) commit transaction
1173
+  (0.1ms) begin transaction
1174
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 145], ["created_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00]]
1175
+  (2.1ms) commit transaction
1176
+ Person Load (0.3ms) SELECT "people".* FROM "people"
1177
+  (0.1ms) begin transaction
1178
+ SQL (0.6ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 142]]
1179
+  (1.4ms) commit transaction
1180
+  (0.0ms) begin transaction
1181
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 143]]
1182
+  (1.3ms) commit transaction
1183
+  (0.0ms) begin transaction
1184
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 144]]
1185
+  (2.1ms) commit transaction
1186
+  (0.2ms) begin transaction
1187
+ SQL (0.7ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:37 UTC +00:00]]
1188
+  (1.4ms) commit transaction
1189
+  (0.1ms) begin transaction
1190
+  (0.5ms) UPDATE "people" SET "birthday" = 240, "updated_at" = '2012-03-12 03:39:37.994244' WHERE "people"."id" = 145
1191
+  (1.9ms) commit transaction
1192
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 145]]
1193
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1194
+  (0.0ms) begin transaction
1195
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 145]]
1196
+  (1.9ms) commit transaction
1197
+  (0.1ms) begin transaction
1198
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 409], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1199
+  (1.3ms) commit transaction
1200
+  (0.1ms) begin transaction
1201
+  (0.4ms) UPDATE "people" SET "birthday" = 25, "updated_at" = '2012-03-12 03:39:38.014599' WHERE "people"."id" = 146
1202
+  (1.2ms) commit transaction
1203
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 146]]
1204
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1205
+  (0.0ms) begin transaction
1206
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 146]]
1207
+  (1.6ms) commit transaction
1208
+  (0.1ms) begin transaction
1209
+ SQL (0.7ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1210
+  (1.3ms) commit transaction
1211
+  (0.1ms) begin transaction
1212
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1213
+  (1.2ms) commit transaction
1214
+ SQL (1.6ms) UPDATE "people" SET birthday = birthday + 32
1215
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1216
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1217
+  (0.1ms) begin transaction
1218
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 147]]
1219
+  (1.9ms) commit transaction
1220
+  (0.1ms) begin transaction
1221
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 148]]
1222
+  (1.4ms) commit transaction
1223
+  (0.1ms) begin transaction
1224
+ SQL (0.8ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1225
+  (1.4ms) commit transaction
1226
+  (0.0ms) begin transaction
1227
+ SQL (1.0ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1228
+  (1.4ms) commit transaction
1229
+ SQL (1.6ms) UPDATE "people" SET birthday = birthday + 32
1230
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1231
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1232
+  (0.1ms) begin transaction
1233
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 149]]
1234
+  (1.3ms) commit transaction
1235
+  (0.1ms) begin transaction
1236
+ SQL (0.5ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 150]]
1237
+  (2.0ms) commit transaction
1238
+  (0.1ms) begin transaction
1239
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1240
+  (1.3ms) commit transaction
1241
+  (0.1ms) begin transaction
1242
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1243
+  (1.3ms) commit transaction
1244
+ SQL (1.4ms) UPDATE "people" SET birthday = birthday & 31
1245
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1246
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1247
+  (0.0ms) begin transaction
1248
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 151]]
1249
+  (1.4ms) commit transaction
1250
+  (0.1ms) begin transaction
1251
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 152]]
1252
+  (1.3ms) commit transaction
1253
+  (0.1ms) begin transaction
1254
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1255
+  (1.3ms) commit transaction
1256
+  (0.1ms) begin transaction
1257
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1258
+  (2.1ms) commit transaction
1259
+ SQL (1.9ms) UPDATE "people" SET birthday = birthday & 31
1260
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1261
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1262
+  (0.0ms) begin transaction
1263
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 153]]
1264
+  (1.4ms) commit transaction
1265
+  (0.1ms) begin transaction
1266
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 154]]
1267
+  (1.7ms) commit transaction
1268
+  (0.1ms) begin transaction
1269
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:38 UTC +00:00]]
1270
+  (1.4ms) commit transaction
1271
+  (0.1ms) begin transaction
1272
+  (0.4ms) UPDATE "people" SET "birthday" = 0, "updated_at" = '2012-03-12 03:39:38.103170' WHERE "people"."id" = 155
1273
+  (1.3ms) commit transaction
1274
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 155]]
1275
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1276
+  (0.0ms) begin transaction
1277
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 155]]
1278
+  (2.3ms) commit transaction
1279
+  (0.1ms) begin transaction
1280
+ SQL (16.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 205], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1281
+  (2.9ms) commit transaction
1282
+  (0.1ms) begin transaction
1283
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 156], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1284
+  (1.6ms) commit transaction
1285
+  (0.1ms) begin transaction
1286
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 145], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1287
+  (2.4ms) commit transaction
1288
+ Person Load (0.3ms) SELECT "people".* FROM "people"
1289
+  (0.1ms) begin transaction
1290
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 156]]
1291
+  (1.4ms) commit transaction
1292
+  (0.1ms) begin transaction
1293
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 157]]
1294
+  (1.7ms) commit transaction
1295
+  (0.1ms) begin transaction
1296
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 158]]
1297
+  (1.8ms) commit transaction
1298
+  (0.1ms) begin transaction
1299
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1300
+  (1.5ms) commit transaction
1301
+  (0.1ms) begin transaction
1302
+  (0.4ms) UPDATE "people" SET "birthday" = 240, "updated_at" = '2012-03-12 03:39:56.729863' WHERE "people"."id" = 159
1303
+  (1.4ms) commit transaction
1304
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 159]]
1305
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1306
+  (0.0ms) begin transaction
1307
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 159]]
1308
+  (1.4ms) commit transaction
1309
+  (0.1ms) begin transaction
1310
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 409], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1311
+  (1.5ms) commit transaction
1312
+  (0.1ms) begin transaction
1313
+  (0.3ms) UPDATE "people" SET "birthday" = 25, "updated_at" = '2012-03-12 03:39:56.747868' WHERE "people"."id" = 160
1314
+  (1.4ms) commit transaction
1315
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 160]]
1316
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1317
+  (0.0ms) begin transaction
1318
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 160]]
1319
+  (1.3ms) commit transaction
1320
+  (0.1ms) begin transaction
1321
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1322
+  (1.6ms) commit transaction
1323
+  (0.1ms) begin transaction
1324
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1325
+  (1.5ms) commit transaction
1326
+ SQL (1.5ms) UPDATE "people" SET birthday = birthday + 32
1327
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1328
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1329
+  (0.0ms) begin transaction
1330
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 161]]
1331
+  (1.5ms) commit transaction
1332
+  (0.1ms) begin transaction
1333
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 162]]
1334
+  (1.6ms) commit transaction
1335
+  (0.3ms) begin transaction
1336
+ SQL (0.7ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1337
+  (2.0ms) commit transaction
1338
+  (0.1ms) begin transaction
1339
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1340
+  (1.4ms) commit transaction
1341
+ SQL (1.7ms) UPDATE "people" SET birthday = birthday + 32
1342
+ Person Load (0.3ms) SELECT "people".* FROM "people"
1343
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1344
+  (0.0ms) begin transaction
1345
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 163]]
1346
+  (3.0ms) commit transaction
1347
+  (0.1ms) begin transaction
1348
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 164]]
1349
+  (1.3ms) commit transaction
1350
+  (0.1ms) begin transaction
1351
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1352
+  (1.3ms) commit transaction
1353
+  (0.0ms) begin transaction
1354
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1355
+  (1.4ms) commit transaction
1356
+ SQL (1.6ms) UPDATE "people" SET birthday = birthday & 31
1357
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1358
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1359
+  (0.0ms) begin transaction
1360
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 165]]
1361
+  (1.3ms) commit transaction
1362
+  (0.0ms) begin transaction
1363
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 166]]
1364
+  (1.2ms) commit transaction
1365
+  (0.1ms) begin transaction
1366
+ SQL (0.7ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1367
+  (2.2ms) commit transaction
1368
+  (0.1ms) begin transaction
1369
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1370
+  (1.6ms) commit transaction
1371
+ SQL (1.8ms) UPDATE "people" SET birthday = birthday & 31
1372
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1373
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1374
+  (0.0ms) begin transaction
1375
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 167]]
1376
+  (1.6ms) commit transaction
1377
+  (0.1ms) begin transaction
1378
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 168]]
1379
+  (1.7ms) commit transaction
1380
+  (0.1ms) begin transaction
1381
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:39:56 UTC +00:00]]
1382
+  (1.3ms) commit transaction
1383
+  (0.1ms) begin transaction
1384
+  (0.3ms) UPDATE "people" SET "birthday" = 0, "updated_at" = '2012-03-12 03:39:56.831268' WHERE "people"."id" = 169
1385
+  (1.3ms) commit transaction
1386
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 169]]
1387
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1388
+  (0.1ms) begin transaction
1389
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 169]]
1390
+  (1.9ms) commit transaction
1391
+  (0.1ms) begin transaction
1392
+ SQL (16.1ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 205], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1393
+  (2.9ms) commit transaction
1394
+  (0.1ms) begin transaction
1395
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 156], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1396
+  (1.4ms) commit transaction
1397
+  (0.1ms) begin transaction
1398
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 145], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1399
+  (2.6ms) commit transaction
1400
+ AREL (0.4ms) SELECT count(id) as month_count, (birthday & 480)/32 as month FROM "people" GROUP BY month
1401
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1402
+  (0.1ms) begin transaction
1403
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 170]]
1404
+  (1.2ms) commit transaction
1405
+  (0.0ms) begin transaction
1406
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 171]]
1407
+  (1.2ms) commit transaction
1408
+  (0.1ms) begin transaction
1409
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 172]]
1410
+  (2.8ms) commit transaction
1411
+  (0.2ms) begin transaction
1412
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1413
+  (1.5ms) commit transaction
1414
+  (0.0ms) begin transaction
1415
+  (0.4ms) UPDATE "people" SET "birthday" = 240, "updated_at" = '2012-03-12 03:41:03.843386' WHERE "people"."id" = 173
1416
+  (1.4ms) commit transaction
1417
+ Person Load (0.4ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 173]]
1418
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1419
+  (0.0ms) begin transaction
1420
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 173]]
1421
+  (1.4ms) commit transaction
1422
+  (0.1ms) begin transaction
1423
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 409], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1424
+  (7.0ms) commit transaction
1425
+  (0.1ms) begin transaction
1426
+  (0.4ms) UPDATE "people" SET "birthday" = 25, "updated_at" = '2012-03-12 03:41:03.869532' WHERE "people"."id" = 174
1427
+  (1.2ms) commit transaction
1428
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 174]]
1429
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1430
+  (0.0ms) begin transaction
1431
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 174]]
1432
+  (1.7ms) commit transaction
1433
+  (0.1ms) begin transaction
1434
+ SQL (4.0ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1435
+  (1.4ms) commit transaction
1436
+  (0.0ms) begin transaction
1437
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1438
+  (1.4ms) commit transaction
1439
+ SQL (1.5ms) UPDATE "people" SET birthday = birthday + 32
1440
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1441
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1442
+  (0.1ms) begin transaction
1443
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 175]]
1444
+  (1.3ms) commit transaction
1445
+  (0.1ms) begin transaction
1446
+ SQL (0.9ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 176]]
1447
+  (2.8ms) commit transaction
1448
+  (0.1ms) begin transaction
1449
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1450
+  (1.3ms) commit transaction
1451
+  (0.1ms) begin transaction
1452
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1453
+  (1.3ms) commit transaction
1454
+ SQL (1.6ms) UPDATE "people" SET birthday = birthday + 32
1455
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1456
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1457
+  (0.1ms) begin transaction
1458
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 177]]
1459
+  (1.3ms) commit transaction
1460
+  (0.1ms) begin transaction
1461
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 178]]
1462
+  (1.3ms) commit transaction
1463
+  (0.1ms) begin transaction
1464
+ SQL (0.9ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1465
+  (2.1ms) commit transaction
1466
+  (0.1ms) begin transaction
1467
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1468
+  (1.3ms) commit transaction
1469
+ SQL (1.4ms) UPDATE "people" SET birthday = birthday & 31
1470
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1471
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1472
+  (0.1ms) begin transaction
1473
+ SQL (0.7ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 179]]
1474
+  (2.4ms) commit transaction
1475
+  (0.1ms) begin transaction
1476
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 180]]
1477
+  (1.4ms) commit transaction
1478
+  (0.1ms) begin transaction
1479
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1480
+  (1.3ms) commit transaction
1481
+  (0.1ms) begin transaction
1482
+ SQL (0.8ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1483
+  (1.8ms) commit transaction
1484
+ SQL (1.4ms) UPDATE "people" SET birthday = birthday & 31
1485
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1486
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1487
+  (0.0ms) begin transaction
1488
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 181]]
1489
+  (1.2ms) commit transaction
1490
+  (0.0ms) begin transaction
1491
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 182]]
1492
+  (1.2ms) commit transaction
1493
+  (0.1ms) begin transaction
1494
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:41:03 UTC +00:00]]
1495
+  (1.2ms) commit transaction
1496
+  (0.0ms) begin transaction
1497
+  (0.4ms) UPDATE "people" SET "birthday" = 0, "updated_at" = '2012-03-12 03:41:03.954735' WHERE "people"."id" = 183
1498
+  (1.1ms) commit transaction
1499
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 183]]
1500
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1501
+  (0.0ms) begin transaction
1502
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 183]]
1503
+  (1.4ms) commit transaction
1504
+  (0.1ms) begin transaction
1505
+ SQL (17.7ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 205], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1506
+  (2.9ms) commit transaction
1507
+  (0.1ms) begin transaction
1508
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 156], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1509
+  (1.3ms) commit transaction
1510
+  (0.1ms) begin transaction
1511
+ SQL (1.9ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 145], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1512
+  (1.9ms) commit transaction
1513
+ Could not log "sql.active_record" event. NoMethodError: undefined method `squeeze' for #<Arel::SelectManager:0x007fa25179a540>
1514
+ TypeError: can't convert Arel::SelectManager into String: #<Arel::SelectManager:0x007fa25179a540>
1515
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1516
+  (0.1ms) begin transaction
1517
+ SQL (0.5ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 184]]
1518
+  (1.3ms) commit transaction
1519
+  (0.1ms) begin transaction
1520
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 185]]
1521
+  (1.3ms) commit transaction
1522
+  (0.1ms) begin transaction
1523
+ SQL (0.5ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 186]]
1524
+  (1.3ms) commit transaction
1525
+  (0.1ms) begin transaction
1526
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1527
+  (1.4ms) commit transaction
1528
+  (0.1ms) begin transaction
1529
+  (0.4ms) UPDATE "people" SET "birthday" = 240, "updated_at" = '2012-03-12 03:47:26.065920' WHERE "people"."id" = 187
1530
+  (1.4ms) commit transaction
1531
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 187]]
1532
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1533
+  (0.1ms) begin transaction
1534
+ SQL (0.5ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 187]]
1535
+  (1.4ms) commit transaction
1536
+  (0.1ms) begin transaction
1537
+ SQL (0.7ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 409], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1538
+  (1.4ms) commit transaction
1539
+  (0.1ms) begin transaction
1540
+  (0.4ms) UPDATE "people" SET "birthday" = 25, "updated_at" = '2012-03-12 03:47:26.087673' WHERE "people"."id" = 188
1541
+  (1.3ms) commit transaction
1542
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 188]]
1543
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1544
+  (0.0ms) begin transaction
1545
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 188]]
1546
+  (1.3ms) commit transaction
1547
+  (0.1ms) begin transaction
1548
+ SQL (2.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1549
+  (1.6ms) commit transaction
1550
+  (0.1ms) begin transaction
1551
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1552
+  (1.3ms) commit transaction
1553
+ SQL (1.8ms) UPDATE "people" SET birthday = birthday + 32
1554
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1555
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1556
+  (0.0ms) begin transaction
1557
+ SQL (0.7ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 189]]
1558
+  (1.7ms) commit transaction
1559
+  (0.1ms) begin transaction
1560
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 190]]
1561
+  (1.3ms) commit transaction
1562
+  (0.1ms) begin transaction
1563
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1564
+  (2.5ms) commit transaction
1565
+  (0.1ms) begin transaction
1566
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1567
+  (2.9ms) commit transaction
1568
+ SQL (2.1ms) UPDATE "people" SET birthday = birthday + 32
1569
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1570
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1571
+  (0.0ms) begin transaction
1572
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 191]]
1573
+  (1.7ms) commit transaction
1574
+  (0.1ms) begin transaction
1575
+ SQL (3.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 192]]
1576
+  (1.4ms) commit transaction
1577
+  (0.1ms) begin transaction
1578
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1579
+  (1.4ms) commit transaction
1580
+  (0.0ms) begin transaction
1581
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1582
+  (1.3ms) commit transaction
1583
+ SQL (2.0ms) UPDATE "people" SET birthday = birthday & 31
1584
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1585
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1586
+  (0.1ms) begin transaction
1587
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 193]]
1588
+  (1.5ms) commit transaction
1589
+  (0.0ms) begin transaction
1590
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 194]]
1591
+  (1.5ms) commit transaction
1592
+  (0.1ms) begin transaction
1593
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1594
+  (1.8ms) commit transaction
1595
+  (0.1ms) begin transaction
1596
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1597
+  (1.3ms) commit transaction
1598
+ SQL (1.7ms) UPDATE "people" SET birthday = birthday & 31
1599
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1600
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1601
+  (0.0ms) begin transaction
1602
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 195]]
1603
+  (1.4ms) commit transaction
1604
+  (0.1ms) begin transaction
1605
+ SQL (0.9ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 196]]
1606
+  (1.6ms) commit transaction
1607
+  (0.1ms) begin transaction
1608
+ SQL (1.2ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:26 UTC +00:00]]
1609
+  (1.9ms) commit transaction
1610
+  (0.1ms) begin transaction
1611
+  (0.3ms) UPDATE "people" SET "birthday" = 0, "updated_at" = '2012-03-12 03:47:26.175551' WHERE "people"."id" = 197
1612
+  (2.0ms) commit transaction
1613
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 197]]
1614
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1615
+  (0.0ms) begin transaction
1616
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 197]]
1617
+  (1.4ms) commit transaction
1618
+  (0.1ms) begin transaction
1619
+ SQL (15.9ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 205], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1620
+  (2.9ms) commit transaction
1621
+  (0.1ms) begin transaction
1622
+ SQL (0.6ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 156], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1623
+  (1.5ms) commit transaction
1624
+  (0.1ms) begin transaction
1625
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 145], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1626
+  (1.7ms) commit transaction
1627
+ AREL (0.4ms) SELECT count(id) as month_count, (birthday & 480)/32 as month FROM "people" GROUP BY month
1628
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1629
+  (0.0ms) begin transaction
1630
+ SQL (0.4ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 198]]
1631
+  (1.3ms) commit transaction
1632
+  (0.1ms) begin transaction
1633
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 199]]
1634
+  (1.5ms) commit transaction
1635
+  (0.1ms) begin transaction
1636
+ SQL (0.2ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 200]]
1637
+  (1.6ms) commit transaction
1638
+  (0.1ms) begin transaction
1639
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1640
+  (1.3ms) commit transaction
1641
+  (0.1ms) begin transaction
1642
+  (0.5ms) UPDATE "people" SET "birthday" = 240, "updated_at" = '2012-03-12 03:47:50.623118' WHERE "people"."id" = 201
1643
+  (1.4ms) commit transaction
1644
+ Person Load (0.4ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 201]]
1645
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1646
+  (0.0ms) begin transaction
1647
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 201]]
1648
+  (1.3ms) commit transaction
1649
+  (0.1ms) begin transaction
1650
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 409], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1651
+  (1.9ms) commit transaction
1652
+  (0.1ms) begin transaction
1653
+  (0.4ms) UPDATE "people" SET "birthday" = 25, "updated_at" = '2012-03-12 03:47:50.642139' WHERE "people"."id" = 202
1654
+  (1.2ms) commit transaction
1655
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 202]]
1656
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1657
+  (0.0ms) begin transaction
1658
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 202]]
1659
+  (1.3ms) commit transaction
1660
+  (0.1ms) begin transaction
1661
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1662
+  (1.2ms) commit transaction
1663
+  (0.0ms) begin transaction
1664
+ SQL (2.2ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1665
+  (1.4ms) commit transaction
1666
+ SQL (1.6ms) UPDATE "people" SET birthday = birthday + 32
1667
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1668
+ Person Load (0.1ms) SELECT "people".* FROM "people" 
1669
+  (0.0ms) begin transaction
1670
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 203]]
1671
+  (1.4ms) commit transaction
1672
+  (0.1ms) begin transaction
1673
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 204]]
1674
+  (1.5ms) commit transaction
1675
+  (0.1ms) begin transaction
1676
+ SQL (3.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1677
+  (1.6ms) commit transaction
1678
+  (0.1ms) begin transaction
1679
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1680
+  (2.5ms) commit transaction
1681
+ SQL (1.8ms) UPDATE "people" SET birthday = birthday + 32
1682
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1683
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1684
+  (0.1ms) begin transaction
1685
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 205]]
1686
+  (1.5ms) commit transaction
1687
+  (0.1ms) begin transaction
1688
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 206]]
1689
+  (1.3ms) commit transaction
1690
+  (0.1ms) begin transaction
1691
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1692
+  (1.8ms) commit transaction
1693
+  (0.1ms) begin transaction
1694
+ SQL (0.8ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1695
+  (1.4ms) commit transaction
1696
+ SQL (1.8ms) UPDATE "people" SET birthday = birthday & 31
1697
+ Person Load (0.3ms) SELECT "people".* FROM "people"
1698
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1699
+  (0.1ms) begin transaction
1700
+ SQL (0.9ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 207]]
1701
+  (1.3ms) commit transaction
1702
+  (0.1ms) begin transaction
1703
+ SQL (0.7ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 208]]
1704
+  (1.3ms) commit transaction
1705
+  (0.1ms) begin transaction
1706
+ SQL (0.4ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1707
+  (1.5ms) commit transaction
1708
+  (0.1ms) begin transaction
1709
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 92], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1710
+  (1.4ms) commit transaction
1711
+ SQL (1.6ms) UPDATE "people" SET birthday = birthday & 31
1712
+ Person Load (0.2ms) SELECT "people".* FROM "people" 
1713
+ Person Load (0.1ms) SELECT "people".* FROM "people"
1714
+  (0.0ms) begin transaction
1715
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 209]]
1716
+  (1.2ms) commit transaction
1717
+  (0.1ms) begin transaction
1718
+ SQL (0.8ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 210]]
1719
+  (1.3ms) commit transaction
1720
+  (0.1ms) begin transaction
1721
+ SQL (0.5ms) INSERT INTO "people" ("birthday", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["birthday", 207], ["created_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00], ["name", nil], ["updated_at", Mon, 12 Mar 2012 03:47:50 UTC +00:00]]
1722
+  (1.6ms) commit transaction
1723
+  (0.1ms) begin transaction
1724
+  (0.3ms) UPDATE "people" SET "birthday" = 0, "updated_at" = '2012-03-12 03:47:50.726059' WHERE "people"."id" = 211
1725
+  (1.8ms) commit transaction
1726
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 211]]
1727
+ Person Load (0.2ms) SELECT "people".* FROM "people"
1728
+  (0.1ms) begin transaction
1729
+ SQL (0.3ms) DELETE FROM "people" WHERE "people"."id" = ? [["id", 211]]
1730
+  (1.5ms) commit transaction
@@ -17,6 +17,10 @@ describe MultiBitField do
17
17
  subject.bitfield_size(:birthday).must_equal 9
18
18
  end
19
19
 
20
+ it "implements a bitfields method" do
21
+ subject.bitfields(:birthday).sort.must_equal [:day, :month]
22
+ end
23
+
20
24
  it "implement reset_mask_for with single field" do
21
25
  subject.reset_mask_for(:birthday, :month).must_equal 31
22
26
  end
@@ -33,6 +37,13 @@ describe MultiBitField do
33
37
  subject.increment_mask_for(:birthday, :month, :day).must_equal 33
34
38
  end
35
39
 
40
+ it "implements only_mask_for with single field" do
41
+ subject.only_mask_for(:birthday, :month).must_equal 480
42
+ end
43
+
44
+ it "implements only_mask_for with multiple fields" do
45
+ subject.only_mask_for(:birthday, :month, :day).must_equal 511
46
+ end
36
47
  end
37
48
 
38
49
  describe "instance methods with nil value" do
@@ -184,4 +195,25 @@ describe MultiBitField do
184
195
  Person.all.map(&:day).must_equal [15, 28]
185
196
  end
186
197
  end
198
+
199
+ describe "counting by bitfields" do
200
+ before do
201
+ Person.create :month => 6, :day => 13
202
+ Person.create :month => 4, :day => 28
203
+ Person.create :month => 4, :day => 17
204
+ end
205
+
206
+ after do
207
+ Person.destroy_all
208
+ end
209
+
210
+ subject do
211
+ Person.count_by :birthday, :month
212
+ end
213
+
214
+ it "counts the resources grouped by a bitfield" do
215
+ subject.must_include({"month_count" => 2, "month" => 4})
216
+ subject.must_include({"month_count" => 1, "month" => 6})
217
+ end
218
+ end
187
219
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_bit_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-03 00:00:00.000000000 -06:00
13
- default_executable:
12
+ date: 2012-03-12 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
- requirement: &70267352364720 !ruby/object:Gem::Requirement
16
+ requirement: &70173152077400 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ~>
@@ -22,10 +21,10 @@ dependencies:
22
21
  version: 3.2.1
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *70267352364720
24
+ version_requirements: *70173152077400
26
25
  - !ruby/object:Gem::Dependency
27
26
  name: sqlite3
28
- requirement: &70267352364300 !ruby/object:Gem::Requirement
27
+ requirement: &70173152076980 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
31
30
  - - ! '>='
@@ -33,10 +32,10 @@ dependencies:
33
32
  version: '0'
34
33
  type: :development
35
34
  prerelease: false
36
- version_requirements: *70267352364300
35
+ version_requirements: *70173152076980
37
36
  - !ruby/object:Gem::Dependency
38
37
  name: minitest
39
- requirement: &70267352363840 !ruby/object:Gem::Requirement
38
+ requirement: &70173152076520 !ruby/object:Gem::Requirement
40
39
  none: false
41
40
  requirements:
42
41
  - - ! '>='
@@ -44,7 +43,7 @@ dependencies:
44
43
  version: '0'
45
44
  type: :development
46
45
  prerelease: false
47
- version_requirements: *70267352363840
46
+ version_requirements: *70173152076520
48
47
  description: ''
49
48
  email:
50
49
  - spiegela@gmail.com
@@ -98,7 +97,6 @@ files:
98
97
  - test/minitest_helper.rb
99
98
  - test/multi_bit_field/core_ext_test.rb
100
99
  - test/multi_bit_field_test.rb
101
- has_rdoc: true
102
100
  homepage:
103
101
  licenses: []
104
102
  post_install_message:
@@ -113,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
111
  version: '0'
114
112
  segments:
115
113
  - 0
116
- hash: 2105517145029265956
114
+ hash: 4583493989101315221
117
115
  required_rubygems_version: !ruby/object:Gem::Requirement
118
116
  none: false
119
117
  requirements:
@@ -122,10 +120,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
120
  version: '0'
123
121
  segments:
124
122
  - 0
125
- hash: 2105517145029265956
123
+ hash: 4583493989101315221
126
124
  requirements: []
127
125
  rubyforge_project:
128
- rubygems_version: 1.6.2
126
+ rubygems_version: 1.8.17
129
127
  signing_key:
130
128
  specification_version: 3
131
129
  summary: Add support for multiple, and varied sized bitfields to Active Record.