-
Notifications
You must be signed in to change notification settings - Fork 32
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
Merge values for default locale and current locale #58
Conversation
This creates a behaviour more in line with the delivery API.
👍 |
Can you add the update to the changelog then we are good to merge this. |
In the short term I think this change makes sense. If breaking backwards compatibility is on the table, I'd really prefer that we remove this weird side-effecting cat = space.entries.find('nyancat')
puts cat.fields
# {:name=>"Nyan Cat", :likes=>["rainbows", "fish"], :color=>"rainbow", :bestFriend=>{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"happycat"}}, :birthday=>#<DateTime: 2011-04-04T22:00:00+00:00 ((2455656j,79200s,0n),+0s,2299161j)>, :lives=>1337, :image=>{"sys"=>{"type"=>"Link", "linkType"=>"Asset", "id"=>"nyancat"}}}
puts cat.fields('tlh')
# {:name=>"Nyan vIghro'", :likes=>["rainbows", "fish"], :color=>"yolo", :bestFriend=>{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"happycat"}}, :birthday=>#<DateTime: 2011-04-04T22:00:00+00:00 ((2455656j,79200s,0n),+0s,2299161j)>, :lives=>1337, :image=>{"sys"=>{"type"=>"Link", "linkType"=>"Asset", "id"=>"nyancat"}}}
puts cat.fields('tlh', default_locale: false)
# {:name=>"Nyan vIghro'", :color=>"yolo"} |
I think that way of using it also works. Personally, I think the |
The change would just allow the user to access all the fields. Also when they would change the name for example and save it again, the other fields would be removed as they are not included in the request. |
@grncdr I'm actually quite happy with the way it works now - keeps the operation of changing locale isolated. |
76256f3
to
bd81af8
Compare
Looks good to merge from my side. |
71c226d
to
3250c29
Compare
3250c29
to
b5d0fbc
Compare
Merge values for default locale and current locale
This creates a behaviour more in line with the delivery API. This seems to be more what people expect.
Example of old behaviour:
Example of new behaviour:
I'm unsure which one is "better", @pxlpnk @grncdr what do you think?