-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support present hash #956
Support present hash #956
Conversation
if key | ||
representation = (@body || {}).merge(key => representation) | ||
elsif entity_class.present? && representation.respond_to?('merge') | ||
representation = (@body || {}).merge(representation) | ||
elsif hash_present && representation.respond_to?('merge') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be respond_to?(:merge)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, removed already.
So, the real question given this code is why isn't |
Another question is what does |
Yes, |
Yes, it's better to |
I think I am missing something. What is the difference in the result between |
For the result, there is no difference.But |
Hm, I can see the argument for a noop class like this. Do you think it belongs in (and sorry to be difficult :) |
I was hesitant to about that, and I am not sure where I can place |
Maybe just |
Ok, it's a good idea.I will change it right now. :). |
end | ||
|
||
it 'presents both dummy presenter' do | ||
puts subject.body.inspect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray puts
here.
Lets put this into a separate _spec file too.
I think the code here looks perfect. This needs an entry in README. Maybe just describe something around using this presenter to keep things consistent? |
I have updated README. |
Merging, thanks for your patience. |
Hey, I still dont get idea behind this change 💃 |
It's entirely to make returning data consistent, if you |
#955