espinita 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -10
- data/lib/espinita/auditor.rb +0 -9
- data/lib/espinita/version.rb +1 -1
- data/lib/espinita.rb +8 -4
- data/spec/dummy/log/test.log +110 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4aa4375a1ac6998d4cb183017d82b67a1c7e7ec2
|
4
|
+
data.tar.gz: 6ef15bbfcc49d7f120fcd91b1197cd5382ce5f1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3546cd6f80e0599393a094f18e72947d543bd0b8e3b7f63cb72cd536eb48b30c0486683f2126f274ced4d7008d62a8c943e98654dd5612a1700bee7476554107
|
7
|
+
data.tar.gz: 4d64b4571a95feec3e2316f302379236fd0481d617d3a24a26dd744f1da57757a156b51390e6d5a8726d1d88373a2f245f3881f6783feab783e4190c342315ae
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Espinita
|
1
|
+
# Espinita
|
2
2
|
|
3
3
|
[![Build Status](https://secure.travis-ci.org/continuum/espinita.png)](http://travis-ci.org/continuum/espinita) [![Dependency Status](https://gemnasium.com/continuum/espinita.png)](https://gemnasium.com/continuum/espinita) [![Coverage Status](https://coveralls.io/repos/continuum/espinita/badge.png?branch=master)](https://coveralls.io/r/continuum/espinita?branch=master)
|
4
4
|
=======
|
@@ -7,18 +7,17 @@
|
|
7
7
|
|
8
8
|
![Alt text](./espinita.jpg)
|
9
9
|
|
10
|
-
Audit activerecord models like a boss
|
10
|
+
Audit activerecord models like a boss. Tested in rails 4 and ruby 2.0.0.
|
11
11
|
|
12
|
-
|
13
|
-
This proyect is heavily based in audited gem.
|
12
|
+
This project is heavily based in audited gem.
|
14
13
|
|
15
14
|
## Installation
|
16
15
|
|
17
|
-
In your gemfile
|
16
|
+
In your gemfile
|
18
17
|
|
19
18
|
gem "espinita"
|
20
19
|
|
21
|
-
In console
|
20
|
+
In console
|
22
21
|
|
23
22
|
$ rake espinita:install:migrations
|
24
23
|
$ rake db:migrate
|
@@ -41,13 +40,13 @@ Espinita provides options to include or exclude columns to trigger the creation
|
|
41
40
|
auditable only: [:title] # except: [:some_column]
|
42
41
|
end
|
43
42
|
|
44
|
-
And
|
43
|
+
And lets you declare the callbacks you want for audit creation:
|
45
44
|
|
46
45
|
class Post < ActiveRecord::Base
|
47
46
|
auditable on: [:create] # on: [:create, :update]
|
48
|
-
end
|
47
|
+
end
|
49
48
|
|
50
|
-
You can find the audits records easily:
|
49
|
+
You can find the audits records easily:
|
51
50
|
|
52
51
|
@post.audits.first #=> #<Espinita::Audit id: 1, auditable_id: 1, auditable_type: "Post", user_id: 1, user_type: "User", audited_changes: {"title"=>[nil, "MyString"], "created_at"=>[nil, 2013-10-30 15:50:14 UTC], "updated_at"=>[nil, 2013-10-30 15:50:14 UTC], "id"=>[nil, 1]}
|
53
52
|
|
@@ -55,6 +54,6 @@ Espinita will save the model changes in a serialized column called audited_chang
|
|
55
54
|
|
56
55
|
@post.audits.firt.audited_changed #=> {"title"=>[nil, "MyString"], "created_at"=>[nil, 2013-10-30 15:50:14 UTC], "updated_at"=>[nil, 2013-10-30 15:50:14 UTC], "id"=>[nil, 1]}
|
57
56
|
|
58
|
-
Espinita will detect current user when records saved from rails controllers.
|
57
|
+
Espinita will detect the current user when records saved from rails controllers. By default Espinita uses current_user method but you can change it:
|
59
58
|
|
60
59
|
Espinita.current_user_method = :authenticated_user
|
data/lib/espinita/auditor.rb
CHANGED
data/lib/espinita/version.rb
CHANGED
data/lib/espinita.rb
CHANGED
@@ -7,10 +7,14 @@ module Espinita
|
|
7
7
|
autoload :AuditorBehavior, "espinita/auditor_behavior"
|
8
8
|
autoload :AuditorRequest, "espinita/auditor_request"
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
class << self
|
11
|
+
|
12
|
+
attr_accessor :current_user_method
|
13
|
+
|
14
|
+
def current_user_method
|
15
|
+
@current_user_method ||= :current_user
|
16
|
+
end
|
17
|
+
|
14
18
|
end
|
15
19
|
|
16
20
|
end
|
data/spec/dummy/log/test.log
CHANGED
@@ -17486,3 +17486,113 @@ Completed 200 OK in 76ms (Views: 4.3ms | ActiveRecord: 1.4ms)
|
|
17486
17486
|
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ?[0m [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
|
17487
17487
|
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
|
17488
17488
|
[1m[36mEspinita::Audit Load (0.1ms)[0m [1mSELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1[0m [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
|
17489
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "last_name" varchar(255), "email" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
17490
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "general_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "name" varchar(255), "settings" text, "position" integer, "created_at" datetime, "updated_at" datetime)
|
17491
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_general_models_on_user_id" ON "general_models" ("user_id")[0m
|
17492
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "espinita_audits" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "auditable_id" integer, "auditable_type" varchar(255), "user_id" integer, "user_type" varchar(255), "audited_changes" text, "comment" varchar(255), "version" integer, "action" varchar(255), "remote_address" varchar(255), "created_at" datetime, "updated_at" datetime)
|
17493
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_espinita_audits_on_auditable_id_and_auditable_type" ON "espinita_audits" ("auditable_id", "auditable_type")[0m
|
17494
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_espinita_audits_on_user_id_and_user_type" ON "espinita_audits" ("user_id", "user_type")
|
17495
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17496
|
+
[1m[35mSQL (2.3ms)[0m INSERT INTO "users" ("created_at", "email", "last_name", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["email", "john@afferson.com"], ["last_name", "Afferson"], ["name", "John"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17497
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
17498
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "espinita_audits"
|
17499
|
+
Processing by AuditsController#audit as HTML
|
17500
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17501
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17502
|
+
[1m[36m (0.2ms)[0m [1mSELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 1 AND "espinita_audits"."auditable_type" = 'GeneralModel'[0m
|
17503
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["action", "create"], ["auditable_id", 1], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.435614000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.435614000 Z\nid:\n- \n- 1\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 1]]
|
17504
|
+
[1m[36mSQL (0.3ms)[0m [1mUPDATE "espinita_audits" SET "updated_at" = ?, "audited_changes" = ? WHERE "espinita_audits"."id" = 1[0m [["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.000000000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.000000000 Z\nid:\n- \n- 1\n"]]
|
17505
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17506
|
+
Rendered text template (0.0ms)
|
17507
|
+
Completed 200 OK in 76ms (Views: 4.3ms | ActiveRecord: 1.4ms)
|
17508
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "espinita_audits"[0m
|
17509
|
+
[1m[35mEspinita::Audit Load (0.2ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 1], ["auditable_type", "GeneralModel"]]
|
17510
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1[0m [["id", 1]]
|
17511
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 1], ["auditable_type", "GeneralModel"]]
|
17512
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17513
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17514
|
+
[1m[36m (0.1ms)[0m [1mSELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 2 AND "espinita_audits"."auditable_type" = 'GeneralModel'[0m
|
17515
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["action", "create"], ["auditable_id", 2], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.516318000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.516318000 Z\nid:\n- \n- 2\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 1]]
|
17516
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
17517
|
+
[1m[35m (0.1ms)[0m begin transaction
|
17518
|
+
[1m[36m (0.1ms)[0m [1mSELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 2 AND "espinita_audits"."auditable_type" = 'GeneralModel'[0m
|
17519
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["action", "update"], ["auditable_id", 2], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- MyString\n- Foo\nupdated_at:\n- 2013-11-04 18:41:03.516318000 Z\n- 2013-11-04 18:41:03.524755000 Z\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 2]]
|
17520
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 2[0m [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17521
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17522
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ?[0m [["auditable_id", 2], ["auditable_type", "GeneralModel"]]
|
17523
|
+
[1m[35m (0.1ms)[0m begin transaction
|
17524
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17525
|
+
[1m[35m (0.1ms)[0m SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 3 AND "espinita_audits"."auditable_type" = 'GeneralModel'
|
17526
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["action", "create"], ["auditable_id", 3], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.532056000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.532056000 Z\nid:\n- \n- 3\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 1]]
|
17527
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17528
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17529
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 3 [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17530
|
+
[1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
17531
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 3], ["auditable_type", "GeneralModel"]]
|
17532
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17533
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17534
|
+
[1m[36m (0.1ms)[0m [1mSELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 4 AND "espinita_audits"."auditable_type" = 'GeneralModel'[0m
|
17535
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["action", "create"], ["auditable_id", 4], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.544439000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.544439000 Z\nid:\n- \n- 4\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 1]]
|
17536
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
17537
|
+
[1m[35m (0.1ms)[0m begin transaction
|
17538
|
+
[1m[36m (0.2ms)[0m [1mSELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 4 AND "espinita_audits"."auditable_type" = 'GeneralModel'[0m
|
17539
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "comment", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["action", "update"], ["auditable_id", 4], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- MyString\n- Foo\nupdated_at:\n- 2013-11-04 18:41:03.544439000 Z\n- 2013-11-04 18:41:03.553755000 Z\n"], ["comment", "Some comment"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 2]]
|
17540
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 4[0m [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17541
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17542
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ?[0m [["auditable_id", 4], ["auditable_type", "GeneralModel"]]
|
17543
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 4], ["auditable_type", "GeneralModel"]]
|
17544
|
+
[1m[36mEspinita::Audit Load (0.1ms)[0m [1mSELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1[0m [["auditable_id", 4], ["auditable_type", "GeneralModel"]]
|
17545
|
+
[1m[35m (0.1ms)[0m begin transaction
|
17546
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17547
|
+
[1m[35m (0.1ms)[0m SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 5 AND "espinita_audits"."auditable_type" = 'GeneralModel'
|
17548
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["action", "create"], ["auditable_id", 5], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.563848000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.563848000 Z\nid:\n- \n- 5\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 1]]
|
17549
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17550
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17551
|
+
[1m[35m (0.1ms)[0m SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 5 AND "espinita_audits"."auditable_type" = 'GeneralModel'
|
17552
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "comment", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["action", "update"], ["auditable_id", 5], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- MyString\n- Foo\nupdated_at:\n- 2013-11-04 18:41:03.563848000 Z\n- 2013-11-04 18:41:03.572556000 Z\n"], ["comment", "Some comment"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 1], ["user_type", "User"], ["version", 2]]
|
17553
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 5 [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17554
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
17555
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 5], ["auditable_type", "GeneralModel"]]
|
17556
|
+
[1m[36mEspinita::Audit Load (0.1ms)[0m [1mSELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1[0m [["auditable_id", 5], ["auditable_type", "GeneralModel"]]
|
17557
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 5], ["auditable_type", "GeneralModel"]]
|
17558
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17559
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "users" ("created_at", "email", "last_name", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["email", "john@afferson.com"], ["last_name", "Afferson"], ["name", "John"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17560
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
17561
|
+
[1m[35m (0.1ms)[0m begin transaction
|
17562
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17563
|
+
[1m[35m (0.1ms)[0m SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 6 AND "espinita_audits"."auditable_type" = 'GeneralModel'
|
17564
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["action", "create"], ["auditable_id", 6], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.582573000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.582573000 Z\nid:\n- \n- 6\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 2], ["user_type", "User"], ["version", 1]]
|
17565
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17566
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17567
|
+
[1m[35m (0.1ms)[0m SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 6 AND "espinita_audits"."auditable_type" = 'GeneralModel'
|
17568
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "comment", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["action", "update"], ["auditable_id", 6], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- MyString\n- Foo\nupdated_at:\n- 2013-11-04 18:41:03.582573000 Z\n- 2013-11-04 18:41:03.592506000 Z\n"], ["comment", "Some comment"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 2], ["user_type", "User"], ["version", 2]]
|
17569
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 6 [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17570
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
17571
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 6], ["auditable_type", "GeneralModel"]]
|
17572
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1[0m [["id", 2]]
|
17573
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 6], ["auditable_type", "GeneralModel"]]
|
17574
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1[0m [["id", 2]]
|
17575
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 6], ["auditable_type", "GeneralModel"]]
|
17576
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1[0m [["id", 2]]
|
17577
|
+
[1m[35m (0.1ms)[0m begin transaction
|
17578
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17579
|
+
[1m[35m (0.1ms)[0m SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 7 AND "espinita_audits"."auditable_type" = 'GeneralModel'
|
17580
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["action", "create"], ["auditable_id", 7], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- \n- MyString\nsettings:\n- \n- MyText\nposition:\n- \n- 1\ncreated_at:\n- \n- 2013-11-04 18:41:03.604511000 Z\nupdated_at:\n- \n- 2013-11-04 18:41:03.604511000 Z\nid:\n- \n- 7\n"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 2], ["user_type", "User"], ["version", 1]]
|
17581
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17582
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
17583
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 7 [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17584
|
+
[1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
17585
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 7], ["auditable_type", "GeneralModel"]]
|
17586
|
+
[1m[36mEspinita::Audit Load (0.1ms)[0m [1mSELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1[0m [["auditable_id", 7], ["auditable_type", "GeneralModel"]]
|
17587
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 7], ["auditable_type", "GeneralModel"]]
|
17588
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17589
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "general_models" ("created_at", "name", "position", "settings", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["name", "MyString"], ["position", 1], ["settings", "MyText"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17590
|
+
[1m[36m (0.1ms)[0m [1mcommit transaction[0m
|
17591
|
+
[1m[35m (0.0ms)[0m begin transaction
|
17592
|
+
[1m[36m (0.2ms)[0m [1mSELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 8 AND "espinita_audits"."auditable_type" = 'GeneralModel'[0m
|
17593
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "espinita_audits" ("action", "auditable_id", "auditable_type", "audited_changes", "comment", "created_at", "remote_address", "updated_at", "user_id", "user_type", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["action", "update"], ["auditable_id", 8], ["auditable_type", "GeneralModel"], ["audited_changes", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nname:\n- MyString\n- Foo\nupdated_at:\n- 2013-11-04 18:41:03.618390000 Z\n- 2013-11-04 18:41:03.620352000 Z\n"], ["comment", "Some comment"], ["created_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["remote_address", "0.0.0.0"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00], ["user_id", 2], ["user_type", "User"], ["version", 1]]
|
17594
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 8[0m [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
|
17595
|
+
[1m[35m (0.1ms)[0m commit transaction
|
17596
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ?[0m [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
|
17597
|
+
[1m[35mEspinita::Audit Load (0.1ms)[0m SELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1 [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
|
17598
|
+
[1m[36mEspinita::Audit Load (0.1ms)[0m [1mSELECT "espinita_audits".* FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? ORDER BY "espinita_audits"."id" DESC LIMIT 1[0m [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
|