simple_audit_trail 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_audit_trail/version.rb +1 -1
- data/lib/simple_audit_trail.rb +12 -9
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +36 -0
- data/spec/dummy/log/test.log +280 -0
- data/spec/lib/simple_audit_trail_auditor_spec.rb +33 -4
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4284f8cd899c49664d1b250746e24e556cfdaa1f
|
4
|
+
data.tar.gz: 1edaf593fdf7726b766c3b3b59050e579393b8d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a05221b99b7dbd3d99e69da02c9cd7bec4485b8626388bd9c1f80733090832f064f67e065b6544cf35a207e564940a72945850b23c32496c0f32dc1a8e4fc47
|
7
|
+
data.tar.gz: 4e90c730ece12b9c87fdc3d6cc22490e2aa335f6107c700239d0ae42ea80dbaf82bc6b8ab2ae2c0cb7a1d8e76c34cec38e4500841b9413044d4379c8f07284be
|
data/lib/simple_audit_trail.rb
CHANGED
@@ -22,19 +22,22 @@ module SimpleAuditTrail
|
|
22
22
|
|
23
23
|
before_update :save_audits
|
24
24
|
define_method :save_audits do
|
25
|
-
|
26
|
-
|
25
|
+
changed_audited_fields = audited_fields.select do |f|
|
26
|
+
send "#{f}_changed?"
|
27
27
|
end
|
28
|
-
if (self.changed & self.audited_fields).any?
|
29
|
-
to = Hash[self.audited_fields.map{|k| [k,self[k]]}]
|
30
|
-
from = to.clone.merge! Hash[
|
31
|
-
self.changes.slice(*self.audited_fields).map{|k,v| [k,v[0]]}
|
32
|
-
]
|
33
28
|
|
34
|
-
|
29
|
+
if changed_audited_fields.present?
|
30
|
+
if audited_user_id.nil? && audit_options[:require_audited_user_id]
|
31
|
+
raise "audited setter method called without setting audited_user_id"
|
32
|
+
end
|
33
|
+
|
34
|
+
to = Hash[audited_fields.map { |f| [f, send(f)] }]
|
35
|
+
from = Hash[audited_fields.map { |f| [f, send("#{f}_was")] }]
|
36
|
+
|
37
|
+
simple_audits.create(
|
35
38
|
:from => from.to_json,
|
36
39
|
:to => to.to_json,
|
37
|
-
:who_id =>
|
40
|
+
:who_id => audited_user_id)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
end
|
Binary file
|
Binary file
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Connecting to database specified by database.yml
|
2
|
+
[1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
3
|
+
[1m[35m (0.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
4
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
5
|
+
[1m[35m (0.0ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
6
|
+
Connecting to database specified by database.yml
|
7
|
+
[1m[36m (0.0ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
8
|
+
Migrating to CreateSimpleAuditTrailAudits (20150512224022)
|
9
|
+
[1m[35m (0.0ms)[0m select sqlite_version(*)
|
10
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
11
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "simple_audit_trail_audits" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "simple_audit_trailable_id" integer, "simple_audit_trailable_type" varchar(255), "who_id" integer, "from" text, "to" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
12
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20150512224022')[0m
|
13
|
+
[1m[35m (0.7ms)[0m commit transaction
|
14
|
+
Migrating to CreateTinas (20150513181325)
|
15
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
16
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "tinas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "ladies" integer, "badonkadonks" integer, "mushy_snugglebites" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
17
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20150513181325')[0m
|
18
|
+
[1m[35m (0.7ms)[0m commit transaction
|
19
|
+
Migrating to CreateMrTorques (20150513221356)
|
20
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
21
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "mr_torques" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "todays_quote" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
22
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20150513221356')[0m
|
23
|
+
[1m[35m (0.7ms)[0m commit transaction
|
24
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
25
|
+
Connecting to database specified by database.yml
|
26
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
27
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
28
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "mr_torques" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "todays_quote" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
29
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "simple_audit_trail_audits" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "simple_audit_trailable_id" integer, "simple_audit_trailable_type" varchar(255), "who_id" integer, "from" text, "to" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
30
|
+
[1m[36m (0.8ms)[0m [1mCREATE TABLE "tinas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "ladies" integer, "badonkadonks" integer, "mushy_snugglebites" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
31
|
+
[1m[35m (0.7ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
32
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
33
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
34
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150513221356')[0m
|
35
|
+
[1m[35m (0.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150513181325')
|
36
|
+
[1m[36m (0.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150512224022')[0m
|
@@ -0,0 +1,280 @@
|
|
1
|
+
Connecting to database specified by database.yml
|
2
|
+
Connecting to database specified by database.yml
|
3
|
+
[1m[36m (0.8ms)[0m [1mDELETE FROM "mr_torques";[0m
|
4
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
5
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'mr_torques';[0m
|
6
|
+
[1m[35m (0.7ms)[0m DELETE FROM "simple_audit_trail_audits";
|
7
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
8
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';
|
9
|
+
[1m[36m (0.7ms)[0m [1mDELETE FROM "tinas";[0m
|
10
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
11
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'tinas';[0m
|
12
|
+
[1m[35m (0.8ms)[0m DELETE FROM "mr_torques";
|
13
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
14
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
15
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
16
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
17
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
18
|
+
[1m[35m (0.7ms)[0m DELETE FROM "tinas";
|
19
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
20
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
21
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22
|
+
[1m[35mSQL (3.1ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 2], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 1], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
23
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
24
|
+
[1m[35m (0.7ms)[0m DELETE FROM "mr_torques";
|
25
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
26
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
27
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
28
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
29
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
30
|
+
[1m[35m (0.5ms)[0m DELETE FROM "tinas";
|
31
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
32
|
+
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
33
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
34
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 2], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 1], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
35
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
36
|
+
[1m[35m (0.6ms)[0m DELETE FROM "mr_torques";
|
37
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
38
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
39
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
40
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
41
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
42
|
+
[1m[35m (0.6ms)[0m DELETE FROM "tinas";
|
43
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
44
|
+
[1m[35m (0.8ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
45
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
46
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
47
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
48
|
+
[1m[35mTina Load (0.1ms)[0m SELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1 [["id", 1]]
|
49
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
50
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "mr_torques" ("created_at", "todays_quote", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["todays_quote", "THAT SENTENCE HAD TOO MANY SYLLABLES! APOLOGIZE!"], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
51
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
52
|
+
[1m[35mMrTorque Load (0.1ms)[0m SELECT "mr_torques".* FROM "mr_torques" WHERE "mr_torques"."id" = ? LIMIT 1 [["id", 1]]
|
53
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "simple_audit_trail_audits" [0m
|
54
|
+
[1m[35m (0.0ms)[0m begin transaction
|
55
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["from", "{\"todays_quote\":\"THAT SENTENCE HAD TOO MANY SYLLABLES! APOLOGIZE!\"}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "MrTorque"], ["to", "{\"todays_quote\":\"If you're still alive, grab some ammo. If you're not,\\n THIS MESSAGE IS IRRELEVANT!\"}"], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["who_id", 345]]
|
56
|
+
[1m[35m (0.1ms)[0m UPDATE "mr_torques" SET "todays_quote" = 'If you''re still alive, grab some ammo. If you''re not,
|
57
|
+
THIS MESSAGE IS IRRELEVANT!', "updated_at" = '2015-07-01 00:35:26.925770' WHERE "mr_torques"."id" = 1
|
58
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
59
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "simple_audit_trail_audits"
|
60
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "mr_torques";[0m
|
61
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
62
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM sqlite_sequence where name = 'mr_torques';[0m
|
63
|
+
[1m[35m (0.6ms)[0m DELETE FROM "simple_audit_trail_audits";
|
64
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
65
|
+
[1m[35m (0.5ms)[0m DELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';
|
66
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM "tinas";[0m
|
67
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
68
|
+
[1m[36m (0.7ms)[0m [1mDELETE FROM sqlite_sequence where name = 'tinas';[0m
|
69
|
+
[1m[35m (0.0ms)[0m begin transaction
|
70
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
71
|
+
[1m[35m (0.7ms)[0m commit transaction
|
72
|
+
[1m[36mTina Load (0.0ms)[0m [1mSELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1[0m [["id", 1]]
|
73
|
+
[1m[35m (0.0ms)[0m begin transaction
|
74
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "mr_torques" ("created_at", "todays_quote", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["todays_quote", "THAT SENTENCE HAD TOO MANY SYLLABLES! APOLOGIZE!"], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
75
|
+
[1m[35m (0.6ms)[0m commit transaction
|
76
|
+
[1m[36mMrTorque Load (0.0ms)[0m [1mSELECT "mr_torques".* FROM "mr_torques" WHERE "mr_torques"."id" = ? LIMIT 1[0m [["id", 1]]
|
77
|
+
[1m[35m (0.0ms)[0m begin transaction
|
78
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["from", "{\"todays_quote\":\"THAT SENTENCE HAD TOO MANY SYLLABLES! APOLOGIZE!\"}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "MrTorque"], ["to", "{\"todays_quote\":\"If you're still alive, grab some ammo. If you're not,\\n THIS MESSAGE IS IRRELEVANT!\"}"], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["who_id", 345]]
|
79
|
+
[1m[35m (0.1ms)[0m UPDATE "mr_torques" SET "todays_quote" = 'If you''re still alive, grab some ammo. If you''re not,
|
80
|
+
THIS MESSAGE IS IRRELEVANT!', "updated_at" = '2015-07-01 00:35:26.961186' WHERE "mr_torques"."id" = 1
|
81
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
82
|
+
[1m[35m (0.6ms)[0m DELETE FROM "mr_torques";
|
83
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
84
|
+
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
85
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
86
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
87
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
88
|
+
[1m[35m (0.5ms)[0m DELETE FROM "tinas";
|
89
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
90
|
+
[1m[35m (0.4ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
91
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
92
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
93
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
94
|
+
[1m[35mTina Load (0.1ms)[0m SELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1 [["id", 1]]
|
95
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
96
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "mr_torques" ("created_at", "todays_quote", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["todays_quote", "THAT SENTENCE HAD TOO MANY SYLLABLES! APOLOGIZE!"], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
97
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
98
|
+
[1m[35mMrTorque Load (0.1ms)[0m SELECT "mr_torques".* FROM "mr_torques" WHERE "mr_torques"."id" = ? LIMIT 1 [["id", 1]]
|
99
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
100
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["from", "{\"todays_quote\":\"THAT SENTENCE HAD TOO MANY SYLLABLES! APOLOGIZE!\"}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "MrTorque"], ["to", "{\"todays_quote\":\"Right now, you're ranked fifty in the badass leaderboards,\\n which puts you behind my grandma but ahead of a guy she gummed to\\n death. IT TOOK SEVERAL HOURS.\"}"], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["who_id", nil]]
|
101
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "mr_torques" SET "todays_quote" = 'Right now, you''re ranked fifty in the badass leaderboards,
|
102
|
+
which puts you behind my grandma but ahead of a guy she gummed to
|
103
|
+
death. IT TOOK SEVERAL HOURS.', "updated_at" = '2015-07-01 00:35:26.972114' WHERE "mr_torques"."id" = 1[0m
|
104
|
+
[1m[35m (0.5ms)[0m commit transaction
|
105
|
+
[1m[36m (0.8ms)[0m [1mDELETE FROM "mr_torques";[0m
|
106
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
107
|
+
[1m[36m (0.7ms)[0m [1mDELETE FROM sqlite_sequence where name = 'mr_torques';[0m
|
108
|
+
[1m[35m (0.6ms)[0m DELETE FROM "simple_audit_trail_audits";
|
109
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
110
|
+
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';
|
111
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "tinas";[0m
|
112
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
113
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM sqlite_sequence where name = 'tinas';[0m
|
114
|
+
[1m[35m (0.0ms)[0m begin transaction
|
115
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
116
|
+
[1m[35m (0.5ms)[0m commit transaction
|
117
|
+
[1m[36mTina Load (0.1ms)[0m [1mSELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1[0m [["id", 1]]
|
118
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "simple_audit_trail_audits"
|
119
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
120
|
+
[1m[35m (0.1ms)[0m UPDATE "tinas" SET "mushy_snugglebites" = '
|
121
|
+
That''s Mushy Snugglebites'' badonkadonk. She''s my main squeeze.
|
122
|
+
Lady''s got a gut fulla'' dynamite and a booty like POOOW!
|
123
|
+
', "updated_at" = '2015-07-01 00:35:26.981186' WHERE "tinas"."id" = 1
|
124
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
125
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "simple_audit_trail_audits"
|
126
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "mr_torques";[0m
|
127
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
128
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'mr_torques';[0m
|
129
|
+
[1m[35m (0.6ms)[0m DELETE FROM "simple_audit_trail_audits";
|
130
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
131
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';
|
132
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "tinas";[0m
|
133
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
134
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM sqlite_sequence where name = 'tinas';[0m
|
135
|
+
[1m[35m (0.0ms)[0m begin transaction
|
136
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
137
|
+
[1m[35m (0.5ms)[0m commit transaction
|
138
|
+
[1m[36mTina Load (0.0ms)[0m [1mSELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1[0m [["id", 1]]
|
139
|
+
[1m[35m (0.0ms)[0m begin transaction
|
140
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "tinas" SET "mushy_snugglebites" = '
|
141
|
+
That''s Mushy Snugglebites'' badonkadonk. She''s my main squeeze.
|
142
|
+
Lady''s got a gut fulla'' dynamite and a booty like POOOW!
|
143
|
+
', "updated_at" = '2015-07-01 00:35:26.988643' WHERE "tinas"."id" = 1[0m
|
144
|
+
[1m[35m (0.5ms)[0m commit transaction
|
145
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "mr_torques";[0m
|
146
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
147
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'mr_torques';[0m
|
148
|
+
[1m[35m (0.5ms)[0m DELETE FROM "simple_audit_trail_audits";
|
149
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
150
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';
|
151
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "tinas";[0m
|
152
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
153
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM sqlite_sequence where name = 'tinas';[0m
|
154
|
+
[1m[35m (0.0ms)[0m begin transaction
|
155
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00]]
|
156
|
+
[1m[35m (0.5ms)[0m commit transaction
|
157
|
+
[1m[36mTina Load (0.1ms)[0m [1mSELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1[0m [["id", 1]]
|
158
|
+
[1m[35m (0.0ms)[0m begin transaction
|
159
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["from", "{\"ladies\":0,\"badonkadonks\":0}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "Tina"], ["to", "{\"ladies\":0,\"badonkadonks\":1}"], ["updated_at", Wed, 01 Jul 2015 00:35:26 UTC +00:00], ["who_id", 123]]
|
160
|
+
[1m[35m (0.1ms)[0m UPDATE "tinas" SET "badonkadonks" = 1, "updated_at" = '2015-07-01 00:35:26.996637' WHERE "tinas"."id" = 1
|
161
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
162
|
+
[1m[35mSimpleAuditTrail::Audit Load (0.1ms)[0m SELECT "simple_audit_trail_audits".* FROM "simple_audit_trail_audits" WHERE "simple_audit_trail_audits"."simple_audit_trailable_id" = 1 AND "simple_audit_trail_audits"."simple_audit_trailable_type" = 'Tina' ORDER BY "simple_audit_trail_audits"."id" DESC LIMIT 1
|
163
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "mr_torques";[0m
|
164
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
165
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'mr_torques';[0m
|
166
|
+
[1m[35m (0.6ms)[0m DELETE FROM "simple_audit_trail_audits";
|
167
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
168
|
+
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';
|
169
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "tinas";[0m
|
170
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
171
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM sqlite_sequence where name = 'tinas';[0m
|
172
|
+
[1m[35m (0.0ms)[0m begin transaction
|
173
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00]]
|
174
|
+
[1m[35m (0.6ms)[0m commit transaction
|
175
|
+
[1m[36mTina Load (0.1ms)[0m [1mSELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1[0m [["id", 1]]
|
176
|
+
[1m[35m (0.0ms)[0m begin transaction
|
177
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["from", "{\"ladies\":0,\"badonkadonks\":0}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "Tina"], ["to", "{\"ladies\":0,\"badonkadonks\":1}"], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["who_id", 123]]
|
178
|
+
[1m[35m (0.1ms)[0m UPDATE "tinas" SET "badonkadonks" = 1, "updated_at" = '2015-07-01 00:35:27.007030' WHERE "tinas"."id" = 1
|
179
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
180
|
+
[1m[35mSimpleAuditTrail::Audit Load (0.1ms)[0m SELECT "simple_audit_trail_audits".* FROM "simple_audit_trail_audits" WHERE "simple_audit_trail_audits"."simple_audit_trailable_id" = 1 AND "simple_audit_trail_audits"."simple_audit_trailable_type" = 'Tina' ORDER BY "simple_audit_trail_audits"."id" DESC LIMIT 1
|
181
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "mr_torques";[0m
|
182
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
183
|
+
[1m[36m (0.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'mr_torques';[0m
|
184
|
+
[1m[35m (0.6ms)[0m DELETE FROM "simple_audit_trail_audits";
|
185
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
186
|
+
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';
|
187
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "tinas";[0m
|
188
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
189
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM sqlite_sequence where name = 'tinas';[0m
|
190
|
+
[1m[35m (0.0ms)[0m begin transaction
|
191
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00]]
|
192
|
+
[1m[35m (0.5ms)[0m commit transaction
|
193
|
+
[1m[36mTina Load (0.1ms)[0m [1mSELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1[0m [["id", 1]]
|
194
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "simple_audit_trail_audits"
|
195
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
196
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["from", "{\"ladies\":0,\"badonkadonks\":0}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "Tina"], ["to", "{\"ladies\":1,\"badonkadonks\":1}"], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["who_id", 123]]
|
197
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "tinas" SET "badonkadonks" = 1, "ladies" = 1, "updated_at" = '2015-07-01 00:35:27.016838' WHERE "tinas"."id" = 1[0m
|
198
|
+
[1m[35m (0.6ms)[0m commit transaction
|
199
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "simple_audit_trail_audits" [0m
|
200
|
+
[1m[35m (0.6ms)[0m DELETE FROM "mr_torques";
|
201
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
202
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
203
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
204
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
205
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
206
|
+
[1m[35m (0.5ms)[0m DELETE FROM "tinas";
|
207
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
208
|
+
[1m[35m (0.5ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
209
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
210
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00]]
|
211
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
212
|
+
[1m[35mTina Load (0.0ms)[0m SELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1 [["id", 1]]
|
213
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
214
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["from", "{\"ladies\":0,\"badonkadonks\":0}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "Tina"], ["to", "{\"ladies\":1,\"badonkadonks\":1}"], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["who_id", 123]]
|
215
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "tinas" SET "badonkadonks" = 1, "ladies" = 1, "updated_at" = '2015-07-01 00:35:27.025394' WHERE "tinas"."id" = 1[0m
|
216
|
+
[1m[35m (0.4ms)[0m commit transaction
|
217
|
+
[1m[36mSimpleAuditTrail::Audit Load (0.1ms)[0m [1mSELECT "simple_audit_trail_audits".* FROM "simple_audit_trail_audits" WHERE "simple_audit_trail_audits"."simple_audit_trailable_id" = 1 AND "simple_audit_trail_audits"."simple_audit_trailable_type" = 'Tina' ORDER BY "simple_audit_trail_audits"."id" DESC LIMIT 1[0m
|
218
|
+
[1m[35m (0.5ms)[0m DELETE FROM "mr_torques";
|
219
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
220
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
221
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
222
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
223
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
224
|
+
[1m[35m (0.5ms)[0m DELETE FROM "tinas";
|
225
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
226
|
+
[1m[35m (0.4ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
227
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
228
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00]]
|
229
|
+
[1m[36m (0.4ms)[0m [1mcommit transaction[0m
|
230
|
+
[1m[35mTina Load (0.0ms)[0m SELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1 [["id", 1]]
|
231
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
232
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["from", "{\"ladies\":0,\"badonkadonks\":0}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "Tina"], ["to", "{\"ladies\":1,\"badonkadonks\":1}"], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["who_id", 123]]
|
233
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "tinas" SET "badonkadonks" = 1, "ladies" = 1, "updated_at" = '2015-07-01 00:35:27.032917' WHERE "tinas"."id" = 1[0m
|
234
|
+
[1m[35m (0.5ms)[0m commit transaction
|
235
|
+
[1m[36mSimpleAuditTrail::Audit Load (0.1ms)[0m [1mSELECT "simple_audit_trail_audits".* FROM "simple_audit_trail_audits" WHERE "simple_audit_trail_audits"."simple_audit_trailable_id" = 1 AND "simple_audit_trail_audits"."simple_audit_trailable_type" = 'Tina' ORDER BY "simple_audit_trail_audits"."id" DESC LIMIT 1[0m
|
236
|
+
[1m[35m (0.6ms)[0m DELETE FROM "mr_torques";
|
237
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
238
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
239
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
240
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
241
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
242
|
+
[1m[35m (0.5ms)[0m DELETE FROM "tinas";
|
243
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
244
|
+
[1m[35m (0.5ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
245
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
246
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00]]
|
247
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
248
|
+
[1m[35mTina Load (0.1ms)[0m SELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1 [["id", 1]]
|
249
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
250
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["from", "{\"ladies\":0,\"badonkadonks\":0}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "Tina"], ["to", "{\"ladies\":1,\"badonkadonks\":1}"], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["who_id", 123]]
|
251
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "tinas" SET "badonkadonks" = 1, "ladies" = 1, "updated_at" = '2015-07-01 00:35:27.041280' WHERE "tinas"."id" = 1[0m
|
252
|
+
[1m[35m (0.5ms)[0m commit transaction
|
253
|
+
[1m[36mSimpleAuditTrail::Audit Load (0.1ms)[0m [1mSELECT "simple_audit_trail_audits".* FROM "simple_audit_trail_audits" WHERE "simple_audit_trail_audits"."simple_audit_trailable_id" = 1 AND "simple_audit_trail_audits"."simple_audit_trailable_type" = 'Tina' ORDER BY "simple_audit_trail_audits"."id" DESC LIMIT 1[0m
|
254
|
+
[1m[35m (0.5ms)[0m DELETE FROM "mr_torques";
|
255
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
256
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
257
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
258
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
259
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
260
|
+
[1m[35m (0.7ms)[0m DELETE FROM "tinas";
|
261
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
262
|
+
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
263
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
264
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "tinas" ("badonkadonks", "created_at", "ladies", "mushy_snugglebites", "updated_at") VALUES (?, ?, ?, ?, ?) [["badonkadonks", 0], ["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["ladies", 0], ["mushy_snugglebites", nil], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00]]
|
265
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
266
|
+
[1m[35mTina Load (0.1ms)[0m SELECT "tinas".* FROM "tinas" WHERE "tinas"."id" = ? LIMIT 1 [["id", 1]]
|
267
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
268
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "simple_audit_trail_audits" ("created_at", "from", "simple_audit_trailable_id", "simple_audit_trailable_type", "to", "updated_at", "who_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["from", "{\"ladies\":0,\"badonkadonks\":0}"], ["simple_audit_trailable_id", 1], ["simple_audit_trailable_type", "Tina"], ["to", "{\"ladies\":1,\"badonkadonks\":1}"], ["updated_at", Wed, 01 Jul 2015 00:35:27 UTC +00:00], ["who_id", 123]]
|
269
|
+
[1m[36m (0.0ms)[0m [1mUPDATE "tinas" SET "badonkadonks" = 1, "ladies" = 1, "updated_at" = '2015-07-01 00:35:27.049864' WHERE "tinas"."id" = 1[0m
|
270
|
+
[1m[35m (0.7ms)[0m commit transaction
|
271
|
+
[1m[36mSimpleAuditTrail::Audit Load (0.1ms)[0m [1mSELECT "simple_audit_trail_audits".* FROM "simple_audit_trail_audits" WHERE "simple_audit_trail_audits"."simple_audit_trailable_id" = 1 AND "simple_audit_trail_audits"."simple_audit_trailable_type" = 'Tina' ORDER BY "simple_audit_trail_audits"."id" DESC LIMIT 1[0m
|
272
|
+
[1m[35m (0.6ms)[0m DELETE FROM "mr_torques";
|
273
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
274
|
+
[1m[35m (0.1ms)[0m DELETE FROM sqlite_sequence where name = 'mr_torques';
|
275
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM "simple_audit_trail_audits";[0m
|
276
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
277
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM sqlite_sequence where name = 'simple_audit_trail_audits';[0m
|
278
|
+
[1m[35m (0.7ms)[0m DELETE FROM "tinas";
|
279
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
280
|
+
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'tinas';
|
@@ -26,10 +26,12 @@ describe SimpleAuditTrail::Auditor do
|
|
26
26
|
)
|
27
27
|
@tina.reload
|
28
28
|
end
|
29
|
+
|
29
30
|
context "when not configured to ignore user" do
|
30
|
-
context "when audited fields have changed" do
|
31
|
+
context "when all audited fields have changed" do
|
31
32
|
before do
|
32
33
|
@tina.badonkadonks = 1
|
34
|
+
@tina.ladies = 1
|
33
35
|
|
34
36
|
# requires an audited_user_id
|
35
37
|
@tina.audited_user_id = 123
|
@@ -43,7 +45,7 @@ describe SimpleAuditTrail::Auditor do
|
|
43
45
|
|
44
46
|
context "the newly created simple_audits record" do
|
45
47
|
before do
|
46
|
-
@tina.save
|
48
|
+
@tina.save
|
47
49
|
end
|
48
50
|
|
49
51
|
it "is an instance of SimpleAuditTrail::Audit" do
|
@@ -54,24 +56,51 @@ describe SimpleAuditTrail::Auditor do
|
|
54
56
|
expect(JSON.parse(@tina.simple_audits.last.from)).
|
55
57
|
to eq JSON.parse("{\"ladies\":0,\"badonkadonks\":0}")
|
56
58
|
end
|
59
|
+
|
57
60
|
it "has a json hash for what the audited values are" do
|
58
61
|
expect(JSON.parse(@tina.simple_audits.last.to)).
|
59
|
-
to eq JSON.parse("{\"ladies\":
|
62
|
+
to eq JSON.parse("{\"ladies\":1,\"badonkadonks\":1}")
|
60
63
|
end
|
64
|
+
|
61
65
|
it "has a who_id for the user who made the change" do
|
62
66
|
expect(@tina.simple_audits.last.who_id).to eq 123
|
63
67
|
end
|
64
68
|
end
|
65
69
|
end
|
66
70
|
|
71
|
+
context "when some but not all audited fields have changed then" do
|
72
|
+
before do
|
73
|
+
@tina.badonkadonks = 1
|
74
|
+
|
75
|
+
# requires an audited_user_id
|
76
|
+
@tina.audited_user_id = 123
|
77
|
+
@tina.save
|
78
|
+
end
|
79
|
+
|
80
|
+
it "has a json hash for what all the audited values were" do
|
81
|
+
expect(JSON.parse(@tina.simple_audits.last.from)).
|
82
|
+
to eq JSON.parse("{\"ladies\":0,\"badonkadonks\":0}")
|
83
|
+
end
|
84
|
+
|
85
|
+
it "has a json hash for what all the audited values are" do
|
86
|
+
expect(JSON.parse(@tina.simple_audits.last.to)).
|
87
|
+
to eq JSON.parse("{\"ladies\":0,\"badonkadonks\":1}")
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
67
91
|
context "when audited fields have not changed" do
|
68
92
|
before do
|
69
93
|
@tina.mushy_snugglebites = "
|
70
94
|
That's Mushy Snugglebites' badonkadonk. She's my main squeeze.
|
71
95
|
Lady's got a gut fulla' dynamite and a booty like POOOW!
|
72
96
|
"
|
73
|
-
@tina.audited_user_id = 123
|
74
97
|
end
|
98
|
+
|
99
|
+
it "does not raise an Exception even if no auditor is set" do
|
100
|
+
expect(@tina.audited_user_id).to be_blank
|
101
|
+
expect { @tina.save }.to_not raise_error
|
102
|
+
end
|
103
|
+
|
75
104
|
it "does not create a SimpleAuditTrail::Audit record" do
|
76
105
|
expect{
|
77
106
|
@tina.save
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_audit_trail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Maujean
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -194,9 +194,13 @@ files:
|
|
194
194
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
195
195
|
- spec/dummy/config/locales/en.yml
|
196
196
|
- spec/dummy/config/routes.rb
|
197
|
+
- spec/dummy/db/development.sqlite3
|
197
198
|
- spec/dummy/db/migrate/20150513181325_create_tinas.rb
|
198
199
|
- spec/dummy/db/migrate/20150513221356_create_mr_torques.rb
|
199
200
|
- spec/dummy/db/schema.rb
|
201
|
+
- spec/dummy/db/test.sqlite3
|
202
|
+
- spec/dummy/log/development.log
|
203
|
+
- spec/dummy/log/test.log
|
200
204
|
- spec/dummy/public/404.html
|
201
205
|
- spec/dummy/public/422.html
|
202
206
|
- spec/dummy/public/500.html
|
@@ -254,9 +258,13 @@ test_files:
|
|
254
258
|
- spec/dummy/config/locales/en.yml
|
255
259
|
- spec/dummy/config/routes.rb
|
256
260
|
- spec/dummy/config.ru
|
261
|
+
- spec/dummy/db/development.sqlite3
|
257
262
|
- spec/dummy/db/migrate/20150513181325_create_tinas.rb
|
258
263
|
- spec/dummy/db/migrate/20150513221356_create_mr_torques.rb
|
259
264
|
- spec/dummy/db/schema.rb
|
265
|
+
- spec/dummy/db/test.sqlite3
|
266
|
+
- spec/dummy/log/development.log
|
267
|
+
- spec/dummy/log/test.log
|
260
268
|
- spec/dummy/public/404.html
|
261
269
|
- spec/dummy/public/422.html
|
262
270
|
- spec/dummy/public/500.html
|