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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5acf753ef41fff92e1b4c38a032fba4ecd4b98b6
4
- data.tar.gz: 13c9482803c0617dcd0d083f0fc1e7bbc51b2603
2
+ SHA256:
3
+ metadata.gz: 494480b027acd773992fe56668936a6ff3efa556ecaa6e51f6de69ae43fa5677
4
+ data.tar.gz: 071fc0a58c8441a3f86038bb477f5f62e0c5858a33134205463b5fadfdc015c8
5
5
  SHA512:
6
- metadata.gz: 3991b2e6e2077c77e22c9988ef3e977feeecb3d1dadd3865ccf176b2d802ad205936d4b609907e575174e2372bc77c51aa6864f65edf1ea6bb6e24223029423c
7
- data.tar.gz: 4c6dc7a43b695040e8ad403bdf6fa848854dd0761d7ebd356469a0addc63e5edc346856129b167ad98896b126778e6c62c85fbf53827f60d629c0e05e3b8fadf
6
+ metadata.gz: 66365887638b2a127998b5a583fb844d2cfa2fdd7716a55865ac8a8e0975a1291f83512f7df1586500aa487de24a3da99b378314ab5517d6165428409e96c21a
7
+ data.tar.gz: e2c7598647b1268cb81fc3ed98fe664188a1a67db54899840649ee435441c9c9092ec8bd9e11f4d459dcf65d0edf3e6cf76b6c4081877768792e32cb070b2ece
data/README.md CHANGED
@@ -65,6 +65,9 @@ def has_footprints options = {}
65
65
  end
66
66
  ```
67
67
 
68
+ ## 多数据库支持的配置方法
69
+ https://github.com/wuyuedefeng/blogs/issues/12
70
+
68
71
  ## Contributing
69
72
  Contribution directions go here.
70
73
 
@@ -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
- attrs_before = {}
11
- attrs_after = {}
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
- attrs_changed.each do |k, v|
14
- attrs_before.store(k, v.first) unless v.first.nil?
15
- attrs_after.store(k, v.last) unless v.last.nil?
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
@@ -1,3 +1,3 @@
1
1
  module Footprintable
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.4'
3
3
  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.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
- - mars
8
- autorequire:
7
+ - sanmu
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-04 00:00:00.000000000 Z
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: '6'
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: '6'
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/wuyuedefeng/footprintable
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
- rubyforge_project:
77
- rubygems_version: 2.6.13
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: []