kasket 2.1.1 → 2.1.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.
- data/lib/kasket/reload_association_mixin.rb +1 -1
- data/lib/kasket/version.rb +1 -1
- data/test/reload_test.rb +11 -0
- metadata +4 -4
@@ -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 ==
|
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
|
data/lib/kasket/version.rb
CHANGED
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.
|
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-
|
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:
|
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:
|
195
|
+
hash: 2508183767050411783
|
196
196
|
requirements: []
|
197
197
|
rubyforge_project:
|
198
198
|
rubygems_version: 1.8.24
|