Entity#serializable_hash must also check if attribute is generated by a user supplied block #208

Merged
merged 2 commits into from Jul 21, 2012

Projects

None yet

2 participants

@ppadron

Tested the latest updates to master with my app and ran into this issue. One of my entities contains a links attribute generated by a block, like this:

expose :links do |model, options|
  [
    { "whatever" => "/link?resource_id=#{model.id}" }
  ]
end

With #203 the :links attribute was not serialized.

ppadron added some commits Jul 20, 2012
@dblock dblock commented on the diff Jul 21, 2012
spec/grape/entity_spec.rb
@@ -252,6 +252,9 @@
subject{ fresh_class.new(model) }
describe '#serializable_hash' do
+
+
+
@dblock
dblock Jul 21, 2012

Space is cheap, but not that cheap :)

@dblock
Ruby Grape member

Thanks, merging.

@dblock dblock merged commit fd65b15 into ruby-grape:master Jul 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment