models_auditor 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/models_auditor/audit_record.rb +5 -1
- data/app/models/models_auditor/audit_request.rb +5 -1
- data/lib/models_auditor/audit.rb +1 -2
- data/lib/models_auditor/config.rb +1 -1
- data/lib/models_auditor/controller.rb +2 -0
- data/lib/models_auditor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f957de6a2eb5bf5af17bc1feb21f59bc45401e46
|
4
|
+
data.tar.gz: 2449ae7454012b6f71e3077ca670cf896d5f8074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 364710a534832e487b1d3936fc18e6950ad6b0788a85850dee375fd5ac6b184596b2c2d6b5cfc67aaa0ac7b327a7007022fa8fe6da034ef06c57507b0c27da4f
|
7
|
+
data.tar.gz: 5f09730b6c5394ff3e53d056ceacfc8fe67c9deb1715be787dc82604aa42befd76884c34b3edbc42ba201bb2bd20326b9e8445e328b408e4b758161bb9de3d87
|
@@ -3,8 +3,12 @@ module ModelsAuditor
|
|
3
3
|
ACTION_CREATE = 0
|
4
4
|
ACTION_UPDATE = 1
|
5
5
|
ACTION_DESTROY = 2
|
6
|
+
begin
|
7
|
+
establish_connection [ModelsAuditor.config.connection_namespace, Rails.env].map(&:presence).compact.join('_').to_sym
|
8
|
+
rescue StandardError
|
9
|
+
# ignored
|
10
|
+
end
|
6
11
|
|
7
|
-
establish_connection [ModelsAuditor.config.connection_namespace, Rails.env].map(&:presence).compact.join('_').to_sym
|
8
12
|
self.table_name = ModelsAuditor.config.audit_records_table_name
|
9
13
|
|
10
14
|
belongs_to :request, class_name: ModelsAuditor::AuditRequest.name, foreign_key: :request_id
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module ModelsAuditor
|
2
2
|
class AuditRequest < ActiveRecord::Base
|
3
|
-
|
3
|
+
begin
|
4
|
+
establish_connection [ModelsAuditor.config.connection_namespace, Rails.env].map(&:presence).compact.join('_').to_sym
|
5
|
+
rescue StandardError
|
6
|
+
# ignored
|
7
|
+
end
|
4
8
|
self.table_name = ModelsAuditor.config.audit_requests_table_name
|
5
9
|
|
6
10
|
has_many :records, class_name: ModelsAuditor::AuditRecord.name, foreign_key: :request_id, inverse_of: :request
|
data/lib/models_auditor/audit.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: models_auditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Gorbunov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|