kasket 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ module Kasket
5
5
  if loaded?
6
6
  Kasket.clear_local if target.class.include?(WriteMixin)
7
7
  else
8
- refl = ActiveRecord::VERSION::MAJOR == 3 ? reflection : proxy_reflection
8
+ refl = (ActiveRecord::VERSION::MAJOR == 2 || AR30) ? proxy_reflection : reflection
9
9
  target_class = (refl.options[:polymorphic] ? (respond_to?(:klass) ? klass : association_class) : refl.klass)
10
10
  Kasket.clear_local if target_class && target_class.include?(WriteMixin)
11
11
  end
@@ -3,7 +3,7 @@ module Kasket
3
3
  class Version
4
4
  MAJOR = 2
5
5
  MINOR = 1
6
- PATCH = 1
6
+ PATCH = 2
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  PROTOCOL = 3
9
9
  end
data/test/reload_test.rb CHANGED
@@ -68,6 +68,17 @@ class ReloadTest < ActiveSupport::TestCase
68
68
  Kasket.expects(:clear_local)
69
69
  @post.reload
70
70
  end
71
+
72
+ should "reload via true" do
73
+ @comment = Comment.first
74
+ assert_equal "few_comments", @comment.post.title
75
+
76
+ Post.update_all("title = 'yyy'", :id => @comment.post_id)
77
+
78
+ assert_equal "few_comments", @comment.post.title
79
+ @comment.post(true) # it does not blow up
80
+ #assert_equal "yyy", @comment.post(true).title # TODO broken in all rails versions...
81
+ end
71
82
  end
72
83
 
73
84
  context "Reloading a has_one_through association" do
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: 2.1.1
4
+ version: 2.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-20 00:00:00.000000000 Z
13
+ date: 2012-11-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: 1246401071380098852
186
+ hash: 2508183767050411783
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements:
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  segments:
194
194
  - 0
195
- hash: 1246401071380098852
195
+ hash: 2508183767050411783
196
196
  requirements: []
197
197
  rubyforge_project:
198
198
  rubygems_version: 1.8.24