onyx-cache-money 0.2.5.3 → 0.2.5.4

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.
@@ -36,9 +36,8 @@ module Cash
36
36
  end
37
37
 
38
38
  def shallow_clone
39
- clone = self.class.new
40
- clone.instance_variable_set("@attributes", instance_variable_get(:@attributes))
41
- clone.instance_variable_set("@new_record", new_record?)
39
+ clone = Object.instance_method(:clone).bind(self).call
40
+ clone.clear_association_cache
42
41
  clone
43
42
  end
44
43
 
@@ -48,7 +48,19 @@ module Cash
48
48
  story = Story.new(:title => 'I am lugubrious')
49
49
  story.characters.build(:name => 'How am I holy?')
50
50
  story.save!
51
- Story.get("id/#{story.id}").first.characters.loaded?.should_not be
51
+ Story.get("id/#{story.id}").first.characters.loaded?.should be_false
52
+ end
53
+
54
+ it "caches extended behavior" do
55
+ story = Story.new(:title => 'I am special')
56
+ module SpecialBehavior
57
+ def special_behavior
58
+ 'woo!'
59
+ end
60
+ end
61
+ story.extend(SpecialBehavior)
62
+ story.save!
63
+ Story.get("id/#{story.id}").first.special_behavior.should == 'woo!'
52
64
  end
53
65
 
54
66
  it 'increments the count' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onyx-cache-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5.3
4
+ version: 0.2.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Kallen