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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9782325a4f946cfa5f1adf2a2d31861abedb66b2
4
- data.tar.gz: 38c99e3abdf1217de822731401fa03ec5dba1c6a
3
+ metadata.gz: 4aa4375a1ac6998d4cb183017d82b67a1c7e7ec2
4
+ data.tar.gz: 6ef15bbfcc49d7f120fcd91b1197cd5382ce5f1c
5
5
  SHA512:
6
- metadata.gz: ac32dde827cb37c8f0af1f8c4b9aea2545eaef0cac3153b5f910b0fa1f83c5f50b2cda6b592d7dce69a8e857139dc783556c5cb7a1e88ae07acc1f27b0065006
7
- data.tar.gz: 554967e32573740dc6ab66aa9185473f22b090219d14ce383ed387876d0935c245b10ef3e4f7c432d675c03d42ccb5d7f53f23e7a7e16ecfa48961ca9634e741
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, tested in rails 4 and ruby 2.0.0.
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 let you declare the callbacks you want for audit creation:
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. by default Espinita use current_user method but you can change it
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
@@ -2,15 +2,6 @@ module Espinita
2
2
  module Auditor
3
3
  extend ActiveSupport::Concern
4
4
  include Espinita::AuditorBehavior
5
-
6
- included do
7
-
8
- end
9
-
10
- module ClassMethods
11
-
12
- end
13
-
14
5
  end
15
6
  end
16
7
 
@@ -1,3 +1,3 @@
1
1
  module Espinita
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.4"
3
3
  end
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
- attr_accessor :current_user_method
11
-
12
- def self.current_user_method
13
- @current_user_method ||= :current_user
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
@@ -17486,3 +17486,113 @@ Completed 200 OK in 76ms (Views: 4.3ms | ActiveRecord: 1.4ms)
17486
17486
   (0.1ms) SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
17487
17487
  Espinita::Audit Load (0.1ms) 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
  Espinita::Audit Load (0.1ms) 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"]]
17489
+  (0.4ms) CREATE 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) 
17490
+  (0.1ms) 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
+  (0.1ms) CREATE INDEX "index_general_models_on_user_id" ON "general_models" ("user_id")
17492
+  (0.1ms) 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
+  (0.1ms) CREATE INDEX "index_espinita_audits_on_auditable_id_and_auditable_type" ON "espinita_audits" ("auditable_id", "auditable_type")
17494
+  (0.1ms) CREATE INDEX "index_espinita_audits_on_user_id_and_user_type" ON "espinita_audits" ("user_id", "user_type")
17495
+  (0.1ms) begin transaction
17496
+ SQL (2.3ms) 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
+  (0.1ms) commit transaction
17498
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits"
17499
+ Processing by AuditsController#audit as HTML
17500
+  (0.1ms) begin transaction
17501
+ SQL (0.3ms) 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
+  (0.2ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 1 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17503
+ SQL (0.3ms) 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
+ SQL (0.3ms) UPDATE "espinita_audits" SET "updated_at" = ?, "audited_changes" = ? WHERE "espinita_audits"."id" = 1 [["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
+  (0.1ms) commit transaction
17506
+ Rendered text template (0.0ms)
17507
+ Completed 200 OK in 76ms (Views: 4.3ms | ActiveRecord: 1.4ms)
17508
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits"
17509
+ Espinita::Audit Load (0.2ms) 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
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
17511
+ Espinita::Audit Load (0.1ms) 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
+  (0.1ms) begin transaction
17513
+ SQL (0.2ms) 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
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 2 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17515
+ SQL (0.2ms) 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
+  (0.1ms) commit transaction
17517
+  (0.1ms) begin transaction
17518
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 2 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17519
+ SQL (0.2ms) 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
+ SQL (0.2ms) UPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 2 [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
17521
+  (0.1ms) commit transaction
17522
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 2], ["auditable_type", "GeneralModel"]]
17523
+  (0.1ms) begin transaction
17524
+ SQL (0.2ms) 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]]
17525
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 3 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17526
+ SQL (0.2ms) 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", 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
+  (0.1ms) commit transaction
17528
+  (0.1ms) begin transaction
17529
+ SQL (0.2ms) 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
+  (0.0ms) commit transaction
17531
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 3], ["auditable_type", "GeneralModel"]]
17532
+  (0.1ms) begin transaction
17533
+ SQL (0.2ms) 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
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 4 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17535
+ SQL (0.2ms) 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
+  (0.1ms) commit transaction
17537
+  (0.1ms) begin transaction
17538
+  (0.2ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 4 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17539
+ SQL (0.3ms) 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
+ SQL (0.1ms) UPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 4 [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
17541
+  (0.1ms) commit transaction
17542
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 4], ["auditable_type", "GeneralModel"]]
17543
+ Espinita::Audit Load (0.1ms) 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
+ Espinita::Audit Load (0.1ms) 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"]]
17545
+  (0.1ms) begin transaction
17546
+ SQL (0.2ms) 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]]
17547
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 5 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17548
+ SQL (0.2ms) 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", 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
+  (0.1ms) commit transaction
17550
+  (0.1ms) begin transaction
17551
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 5 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17552
+ SQL (0.2ms) 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", 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
+ SQL (0.1ms) 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
+  (0.1ms) commit transaction
17555
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 5], ["auditable_type", "GeneralModel"]]
17556
+ Espinita::Audit Load (0.1ms) 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"]]
17557
+ Espinita::Audit Load (0.1ms) 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
+  (0.1ms) begin transaction
17559
+ SQL (0.2ms) 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
+  (0.1ms) commit transaction
17561
+  (0.1ms) begin transaction
17562
+ SQL (0.2ms) 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]]
17563
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 6 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17564
+ SQL (0.2ms) 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", 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
+  (0.1ms) commit transaction
17566
+  (0.1ms) begin transaction
17567
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 6 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17568
+ SQL (0.3ms) 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", 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
+ SQL (0.1ms) 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
+  (0.1ms) commit transaction
17571
+ Espinita::Audit Load (0.1ms) 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
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 2]]
17573
+ Espinita::Audit Load (0.1ms) 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
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 2]]
17575
+ Espinita::Audit Load (0.1ms) 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
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 2]]
17577
+  (0.1ms) begin transaction
17578
+ SQL (0.2ms) 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]]
17579
+  (0.1ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 7 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17580
+ SQL (0.2ms) 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", 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
+  (0.1ms) commit transaction
17582
+  (0.0ms) begin transaction
17583
+ SQL (0.2ms) 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
+  (0.0ms) commit transaction
17585
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 7], ["auditable_type", "GeneralModel"]]
17586
+ Espinita::Audit Load (0.1ms) 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"]]
17587
+ Espinita::Audit Load (0.1ms) 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
+  (0.1ms) begin transaction
17589
+ SQL (0.3ms) 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
+  (0.1ms) commit transaction
17591
+  (0.0ms) begin transaction
17592
+  (0.2ms) SELECT MAX("espinita_audits"."version") AS max_id FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = 8 AND "espinita_audits"."auditable_type" = 'GeneralModel'
17593
+ SQL (0.2ms) 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
+ SQL (0.1ms) UPDATE "general_models" SET "name" = ?, "updated_at" = ? WHERE "general_models"."id" = 8 [["name", "Foo"], ["updated_at", Mon, 04 Nov 2013 18:41:03 UTC +00:00]]
17595
+  (0.1ms) commit transaction
17596
+  (0.1ms) SELECT COUNT(*) FROM "espinita_audits" WHERE "espinita_audits"."auditable_id" = ? AND "espinita_audits"."auditable_type" = ? [["auditable_id", 8], ["auditable_type", "GeneralModel"]]
17597
+ Espinita::Audit Load (0.1ms) 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
+ Espinita::Audit Load (0.1ms) 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"]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: espinita
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Michelson