effective_resources 0.3.4 → 0.3.5

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
2
  SHA1:
3
- metadata.gz: 80f8bb76be22a155d74952c74d008382e1ba7cd7
4
- data.tar.gz: 06fa5f406c156ed2dbe2ef413e3f0f5a57a6214c
3
+ metadata.gz: b018fe0f5e92d239f3139ac0eb959167099ee33f
4
+ data.tar.gz: 2459f02e66bfabf218e2aa532d18fae10fdf910f
5
5
  SHA512:
6
- metadata.gz: 6a3aab4b276571bdf76024ea8b381173b640fb748c06126d565f84f3fdf92c62177fd5ac61f13dce78cff23dce3fbc25799ecae87273cc5347a8925fcc778e60
7
- data.tar.gz: 42ed251bf078e6b173639083e8b68bc5b2fa0955b3bba97e3214c9330e9d0a284d3664304acadf1242916a7f09665f95850ea401a527b15cb4def8ffcc7f2c9b
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::AbstractReflection
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::AbstractReflection
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|
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '0.3.4'.freeze
2
+ VERSION = '0.3.5'.freeze
3
3
  end
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
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-06 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails