kasket 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/kasket.rb CHANGED
@@ -15,7 +15,7 @@ module Kasket
15
15
  class Version
16
16
  MAJOR = 0
17
17
  MINOR = 7
18
- PATCH = 1
18
+ PATCH = 2
19
19
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
20
20
  end
21
21
 
@@ -1,7 +1,13 @@
1
1
  module Kasket
2
2
  module ReloadAssociationMixin
3
+ # TODO write tests for this
3
4
  def reload_with_kasket_clearing(*args)
4
- Kasket.clear_local if include?(WriteMixin)
5
+ if loaded?
6
+ Kasket.clear_local if target.class.include?(WriteMixin)
7
+ else
8
+ target_class = proxy_reflection.options[:polymorphic] ? association_class : proxy_reflection.klass
9
+ Kasket.clear_local if target_class.include?(WriteMixin)
10
+ end
5
11
 
6
12
  reload_without_kasket_clearing(*args)
7
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard