footprintable 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -0
- data/lib/footprintable/instance_methods.rb +10 -6
- data/lib/footprintable/version.rb +1 -1
- metadata +12 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 494480b027acd773992fe56668936a6ff3efa556ecaa6e51f6de69ae43fa5677
|
4
|
+
data.tar.gz: 071fc0a58c8441a3f86038bb477f5f62e0c5858a33134205463b5fadfdc015c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66365887638b2a127998b5a583fb844d2cfa2fdd7716a55865ac8a8e0975a1291f83512f7df1586500aa487de24a3da99b378314ab5517d6165428409e96c21a
|
7
|
+
data.tar.gz: e2c7598647b1268cb81fc3ed98fe664188a1a67db54899840649ee435441c9c9092ec8bd9e11f4d459dcf65d0edf3e6cf76b6c4081877768792e32cb070b2ece
|
data/README.md
CHANGED
@@ -7,14 +7,18 @@ module Footprintable
|
|
7
7
|
attrs_changed = attrs_changed.except *self.class.footprint_options[:except]
|
8
8
|
attrs_changed = attrs_changed.extract! *self.class.footprint_options[:extract] if self.class.footprint_options[:extract].present?
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
if action === :destroy
|
11
|
+
self.footprints.model.new(before: self, after: {}, action: action, trackable: self, actorable: Current.actor).save(validate: false)
|
12
|
+
else
|
13
|
+
attrs_before = {}
|
14
|
+
attrs_after = {}
|
12
15
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
attrs_changed.each do |k, v|
|
17
|
+
attrs_before.store(k, v.first)# unless v.first.nil?
|
18
|
+
attrs_after.store(k, v.last)# unless v.last.nil?
|
19
|
+
end
|
20
|
+
self.footprints.model.new(before: attrs_before, after: attrs_after, action: action, trackable: self, actorable: Current.actor).save(validate: false)
|
16
21
|
end
|
17
|
-
self.footprints.model.new(before: attrs_before, after: attrs_after, action: action, trackable: self, actorable: Current.actor).save(validate: false)
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: footprintable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- sanmu
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,11 +54,11 @@ files:
|
|
54
54
|
- lib/footprintable/instance_methods.rb
|
55
55
|
- lib/footprintable/version.rb
|
56
56
|
- lib/tasks/footprintable_tasks.rake
|
57
|
-
homepage: https://github.com/
|
57
|
+
homepage: https://github.com/rails-gems/footprintable
|
58
58
|
licenses:
|
59
59
|
- MIT
|
60
60
|
metadata: {}
|
61
|
-
post_install_message:
|
61
|
+
post_install_message:
|
62
62
|
rdoc_options: []
|
63
63
|
require_paths:
|
64
64
|
- lib
|
@@ -73,9 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
|
-
|
77
|
-
|
78
|
-
signing_key:
|
76
|
+
rubygems_version: 3.2.22
|
77
|
+
signing_key:
|
79
78
|
specification_version: 4
|
80
79
|
summary: track model column change.
|
81
80
|
test_files: []
|