Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

ppadron
Copy link
Contributor

@ppadron ppadron commented Jul 20, 2012

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.

Pedro Padron added 2 commits July 20, 2012 19:42
…returned by a block (therefore absent from the object) would not be serialized
@@ -252,6 +252,9 @@
subject{ fresh_class.new(model) }

describe '#serializable_hash' do



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space is cheap, but not that cheap :)

@dblock
Copy link
Member

dblock commented Jul 21, 2012

Thanks, merging.

dblock added a commit that referenced this pull request Jul 21, 2012
Entity#serializable_hash must also check if attribute is generated by a user supplied block
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants