representable 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ h2. 1.1.2
2
+
3
+ * Allow `Module.hash` to be called without arguments as this seems to be required in Padrino.
4
+
1
5
  h2. 1.1.1
2
6
 
3
7
  * When a representer module is extended we no longer set the <code>@representable_attrs</code> ivar directly but use a setter. This makes it work with mongoid and fixes https://github.com/apotonick/roar/issues/10.
@@ -125,7 +125,9 @@ private
125
125
  property(name, options)
126
126
  end
127
127
 
128
- def hash(name, options={})
128
+ def hash(name=nil, options={})
129
+ return super() unless name # allow Object.hash.
130
+
129
131
  options[:hash] = true
130
132
  property(name, options)
131
133
  end
@@ -1,3 +1,3 @@
1
1
  module Representable
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -161,6 +161,12 @@ class RepresentableTest < MiniTest::Spec
161
161
  end
162
162
  end
163
163
 
164
+ describe "#hash" do
165
+ it "also responds to the original method" do
166
+ assert_kind_of Integer, BandRepresentation.hash
167
+ end
168
+ end
169
+
164
170
 
165
171
  describe "#representation_wrap" do
166
172
  class HardcoreBand
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 1
9
- version: 1.1.1
8
+ - 2
9
+ version: 1.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nick Sutterer
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-02-06 00:00:00 +01:00
17
+ date: 2012-03-01 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency