active_audit 0.1.0 → 1.0.0

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: 3639ddec358dc194b95215ac12caa995fc05760f
4
- data.tar.gz: 28917214926c09dab3beeb569c63ffaf46f4debe
3
+ metadata.gz: 16454d4e21b0bc4feabfa1858dffbd5496b1646e
4
+ data.tar.gz: b9a1a01b0043f15a57d4f65b22a466e1c591ce0e
5
5
  SHA512:
6
- metadata.gz: 33ef0015420b4123923c6b0ce6c241f1fbafe353b4945ff49be485ac38ea00fe305c2c50620bf2196d968621e9a8560c26cca9ee71643c02891ca8568f1be365
7
- data.tar.gz: eaa2b2385daf2418ac94a3eecc039e95c366e820e5653bc7b818345f96b8901db662124eb4b32cd3389cbf7b9adcb4db4101ae0d793153329df17a39c2fdbb93
6
+ metadata.gz: e01a7fd05d2190fb7e84e3815c140b99f1fc17b09d8a9b20fcef43cd7d2f851e1681ba9368b5183a7f74f58ae976e8b7fc9ce02b8e24ac223126c2a5044d36e5
7
+ data.tar.gz: 992f963db94957563412673198e951e2fefa4d9af52741923120b5c14392b85906d70f212b987665e72c5d01b2d5b51fb4fc678e533b9e476c62ae07c2e48127
@@ -1,3 +1,3 @@
1
1
  module ActiveAudit
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -4,7 +4,6 @@ class CreateAudits < ActiveRecord::Migration
4
4
  t.references :auditable, null: false, index: true, polymorphic: true
5
5
  t.references :user, index: true
6
6
  t.integer :source, null: false, default: 0
7
- t.integer :version, null: false, default: 0
8
7
  t.string :action, null: false
9
8
  t.text :revisions
10
9
  t.text :comment
@@ -16,6 +16,18 @@ class Audit < ActiveRecord::Base
16
16
  validates :user_id, numericality: { integer: true },
17
17
  allow_blank: true,
18
18
  allow_nil: true
19
- validates :version, numericality: { integer: true }
19
+
20
+ def self.record!(object, action, user: ActiveAudit.configuration.auditor, source: :app, comment: nil, remote_ip: nil, remote_uuid: nil)
21
+ create!({
22
+ auditable: object,
23
+ user: user,
24
+ source: source,
25
+ action: action,
26
+ revisions: object.changes,
27
+ comment: comment,
28
+ remote_ip: remote_ip,
29
+ remote_uuid: remote_uuid
30
+ })
31
+ end
20
32
 
21
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez