grape-entity 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22fd603c80eeb68f64892de2f1ca6873c12b20ae
4
- data.tar.gz: 63638985ec1e6d721d54885840ad66c54f14ac9c
3
+ metadata.gz: 2a2e44f74dcea5b8a3246cff9b4e37e9bb41ebe3
4
+ data.tar.gz: 73cd0f7449e63b8a23db6930216b45cc1346e620
5
5
  SHA512:
6
- metadata.gz: b1d88f629ac5188cd05ee77fa32641eb431a44b088c9ac17375c17100ccc6b314b04aad0ffae6f299af21d7fb4b6d33a6ff5c53ce9b64c50b7e5ca483761e0c4
7
- data.tar.gz: e40e7c4e6fee4fef015cc554a38f8e6a44fb05e23142b0932263e059f97a9a9948d012e70f9e9a6f8084a83dd181894afb43d49c208a61712277ab09572f1809
6
+ metadata.gz: 434022e3992890cd9328770146b07156ba5ce0ff64321f659b7216cae73f06e426a5b800caf4f47338e7ef665d1e66352cda437203a57601b1bc47ffb50a28bf
7
+ data.tar.gz: 87e69046e3564712b3648ba10f05f8166e77230503cb0561808302987823494cbb2f540219fa0ae9422994b38a38bbc144b15236e6a2f6bf1c129f134f69f67c
@@ -1,3 +1,7 @@
1
+ 0.4.7 (2015-08-03)
2
+ ==================
3
+ * [#164](https://github.com/intridea/grape-entity/pull/164): Regression: entity instance methods were exposed with `NoMethodError`: [#163](https://github.com/intridea/grape-entity/issues/163) - [@marshall-lee](http://github.com/marshall-lee).
4
+
1
5
  0.4.6 (2015-07-27)
2
6
  ==================
3
7
 
@@ -589,10 +589,11 @@ module Grape
589
589
  true
590
590
  else
591
591
  name = self.class.name_for(attribute)
592
+ is_delegatable = delegator.delegatable?(name) || respond_to?(name, true)
592
593
  if exposure_options[:safe]
593
- delegator.delegatable?(name)
594
+ is_delegatable
594
595
  else
595
- delegator.delegatable?(name) || fail(NoMethodError, "#{self.class.name} missing attribute `#{name}' on #{object}")
596
+ is_delegatable || fail(NoMethodError, "#{self.class.name} missing attribute `#{name}' on #{object}")
596
597
  end
597
598
  end
598
599
  end
@@ -1,3 +1,3 @@
1
1
  module GrapeEntity
2
- VERSION = '0.4.6'
2
+ VERSION = '0.4.7'
3
3
  end
@@ -1198,6 +1198,10 @@ describe Grape::Entity do
1198
1198
  rep = EntitySpec::DelegatingEntity.new(friend)
1199
1199
  expect(rep.send(:value_for, :name)).to eq 'cooler name'
1200
1200
  expect(rep.send(:value_for, :email)).to eq 'joe@example.com'
1201
+
1202
+ another_friend = double('Friend', email: 'joe@example.com')
1203
+ rep = EntitySpec::DelegatingEntity.new(another_friend)
1204
+ expect(rep.send(:value_for, :name)).to eq 'cooler name'
1201
1205
  end
1202
1206
 
1203
1207
  context 'using' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-entity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh