effective_resources 0.3.4 → 0.3.5
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b018fe0f5e92d239f3139ac0eb959167099ee33f
|
|
4
|
+
data.tar.gz: 2459f02e66bfabf218e2aa532d18fae10fdf910f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75db72dc613e30bcb488620e2dc15d900ae8dd8cabc6dca51a3ec100d55385e339c353667438a7bb03d9e1518837eb3b9038d9c01fa22cecb6734087cb22fe3e
|
|
7
|
+
data.tar.gz: ea6d9ff7eb2a2c63dc7a84462387d490564e13038db5a6984a23ce6d75be06f577cdf7bb7bfaa1bd45b90fc2320ddefcb1db14cbde009a861a7620403569d079
|
|
@@ -12,7 +12,7 @@ module Effective
|
|
|
12
12
|
_klass_by_name(input)
|
|
13
13
|
when ActiveRecord::Relation
|
|
14
14
|
input.klass
|
|
15
|
-
when ActiveRecord::Reflection::
|
|
15
|
+
when ActiveRecord::Reflection::MacroReflection
|
|
16
16
|
input.klass unless input.options[:polymorphic]
|
|
17
17
|
when ActionDispatch::Journey::Route
|
|
18
18
|
_klass_by_name(input.defaults[:controller])
|
|
@@ -50,7 +50,7 @@ module Effective
|
|
|
50
50
|
case input
|
|
51
51
|
when ActiveRecord::Relation
|
|
52
52
|
input
|
|
53
|
-
when ActiveRecord::Reflection::
|
|
53
|
+
when ActiveRecord::Reflection::MacroReflection
|
|
54
54
|
klass.where(nil).merge(input.scope) if input.scope
|
|
55
55
|
end || klass.where(nil)
|
|
56
56
|
end
|
|
@@ -32,9 +32,11 @@ module Effective
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def instance_changes
|
|
35
|
-
return {} unless instance.present?
|
|
35
|
+
return {} unless (instance.present? && instance.changes.present?)
|
|
36
36
|
|
|
37
|
-
changes = instance.changes
|
|
37
|
+
changes = instance.changes.delete_if do |attribute, (before, after)|
|
|
38
|
+
(before.kind_of?(ActiveSupport::TimeWithZone) && after.kind_of?(ActiveSupport::TimeWithZone) && before.to_i == after.to_i)
|
|
39
|
+
end
|
|
38
40
|
|
|
39
41
|
# Log to_s changes on all belongs_to associations
|
|
40
42
|
belong_tos.each do |association|
|
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: 0.3.
|
|
4
|
+
version: 0.3.5
|
|
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: 2017-04-
|
|
11
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|