effective_resources 2.30.1 → 2.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7cbfc6f6ed5a78035d8bf09bc3c0c2805926fab8e09b374a0a69ccc99fd5b68
|
4
|
+
data.tar.gz: 0a5c3c5ef964a9b35f7cb3cc04168b62fb4a96fe48b136de17898f6029cf5ca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a7d51930c1956ca7764c0cd7e810d18d802220eb34cdb3802ea5c07e0fab062bb954c00c7366033393a8ac39e14e5397c0f660e23bf566a20260efd83ac449a
|
7
|
+
data.tar.gz: 79b9aa4c4f241ceb20a3b543653c21605754786baa556869c65c6984c74477fcca9b6843ed50f56388c0355f7661e026aecdf58480de7d0bf77154b623e4e162
|
@@ -45,22 +45,22 @@ module ActsAsStatused
|
|
45
45
|
before_validation do
|
46
46
|
self.status ||= all_statuses.first
|
47
47
|
|
48
|
-
# Set an existing belongs_to automatically
|
49
|
-
if respond_to?("#{status}_by") && send("#{status}_by").blank?
|
50
|
-
self.send("#{status}_by=", current_user)
|
51
|
-
end
|
52
|
-
|
53
48
|
# Set an existing timestamp automatically
|
54
49
|
if respond_to?("#{status}_at") && send("#{status}_at").blank?
|
55
50
|
self.send("#{status}_at=", Time.zone.now)
|
56
51
|
end
|
57
52
|
|
58
|
-
|
59
|
-
|
60
|
-
|
53
|
+
self.status_steps["#{status}_at".to_sym] ||= Time.zone.now
|
54
|
+
end
|
55
|
+
|
56
|
+
before_validation(if: -> { status_changed? && current_user.present? }) do
|
57
|
+
# Set an existing belongs_to automatically
|
58
|
+
if respond_to?("#{status}_by") && send("#{status}_by").blank?
|
59
|
+
self.send("#{status}_by=", current_user)
|
61
60
|
end
|
62
61
|
|
63
|
-
self.status_steps["#{status}
|
62
|
+
self.status_steps["#{status}_by_id".to_sym] ||= current_user.id
|
63
|
+
self.status_steps["#{status}_by_type".to_sym] ||= current_user.class.name
|
64
64
|
end
|
65
65
|
|
66
66
|
validates :status, presence: true, inclusion: { in: const_get(:STATUSES).map(&:to_s) }
|
@@ -103,6 +103,7 @@ module Effective
|
|
103
103
|
changes = instance.previous_changes.symbolize_keys.delete_if do |attribute, (before, after)|
|
104
104
|
begin
|
105
105
|
(before.kind_of?(ActiveSupport::TimeWithZone) && after.kind_of?(ActiveSupport::TimeWithZone) && before.to_i == after.to_i) ||
|
106
|
+
(before.kind_of?(Hash) && after.kind_of?(Hash) && before == after) ||
|
106
107
|
(before == nil && after == false) || (before == nil && after == ''.freeze)
|
107
108
|
rescue => e
|
108
109
|
true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.30.
|
4
|
+
version: 2.30.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|