perpetuity 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 0.6.1
2
+
3
+ - Fix reference equality bug
4
+
1
5
  ## Version 0.6.0
2
6
 
3
7
  - Stop extending persisted/retrieved objects with `Perpetuity::PersistedObject`. Extending these objects invalidates method caches inside the VM, which degrades performance.
@@ -10,7 +10,7 @@ module Perpetuity
10
10
  if other.is_a? self.class
11
11
  klass == other.klass && id == other.id
12
12
  else
13
- other.is_a?(klass) && id == other.id
13
+ other.is_a?(klass) && id == other.instance_variable_get(:@id)
14
14
  end
15
15
  end
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Perpetuity
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -3,9 +3,11 @@ require 'perpetuity/reference'
3
3
  module Perpetuity
4
4
  describe Reference do
5
5
  let(:reference) { Reference.new Object, 1 }
6
- let(:object) { double('Object', class: Object, id: 1) }
6
+ let(:object) { double('Object', class: Object) }
7
7
  subject { reference }
8
8
 
9
+ before { object.instance_variable_set :@id, 1 }
10
+
9
11
  its(:klass) { should be Object }
10
12
  its(:id) { should be == 1 }
11
13
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: perpetuity
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.0
5
+ version: 0.6.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jamie Gaskins