File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Metrics/AbcSize:
12
12
# Offense count: 1
13
13
# Configuration parameters: CountComments.
14
14
Metrics/ClassLength :
15
- Max : 292
15
+ Max : 296
16
16
17
17
# Offense count: 4
18
18
Metrics/CyclomaticComplexity :
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Next Release
4
4
* Your contribution here.
5
5
* [ #98 ] ( https://github.com/intridea/grape-entity/pull/98 ) : Add nested conditionals - [ @zbelzer ] ( https://github.com/zbelzer ) .
6
6
* [ #91 ] ( https://github.com/intridea/grape-entity/pull/91 ) : Fix OpenStruct serializing - [ @etehtsea ] ( https://github.com/etehtsea ) .
7
+ * [ #105 ] ( https://github.com/intridea/grape-entity/pull/105 ) : Specify which attribute is missing in which Entity - [ @jhollinger ] ( https://github.com/jhollinger ) .
7
8
8
9
0.4.4 (2014-08-17)
9
10
==================
Original file line number Diff line number Diff line change @@ -558,7 +558,11 @@ def delegate_attribute(attribute)
558
558
elsif object . respond_to? ( :fetch , true )
559
559
object . fetch ( name )
560
560
else
561
- object . send ( name )
561
+ begin
562
+ object . send ( name )
563
+ rescue NoMethodError
564
+ raise NoMethodError , "#{ self . class . name } missing attribute `#{ name } ' on #{ object } "
565
+ end
562
566
end
563
567
end
564
568
end
Original file line number Diff line number Diff line change @@ -462,7 +462,7 @@ class Parent < Person
462
462
subject . expose ( :awesome )
463
463
expect do
464
464
subject . represent ( Object . new , serializable : true )
465
- end . to raise_error ( NoMethodError )
465
+ end . to raise_error ( NoMethodError , /missing attribute `awesome'/ )
466
466
end
467
467
end
468
468
You can’t perform that action at this time.
0 commit comments