Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

FIX: Appropriately assign values when fetching user details#100

Merged
nattsw merged 3 commits intomainfromassign-false-correctly
Mar 21, 2024

Conversation

@nattsw
Copy link
Contributor

@nattswnattsw commentedMar 21, 2024
edited
Loading

Currently, in a user json withfalse values, due to a|| operator, the value incorrectly evaluates to the right hand side. This was causing an issue.

e.g.

deref = fragment[first_seg] || fragment[first_seg.to_sym]

This PR fixes that and appropriately assignsfalse to the specified path for user details.

segments=parse_segments(path)
val=walk_path(user_json,segments)
result[prop]=valifval.present?
# [] should be nil, false should be false
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

There's already a test for the []->nil
it "can walk json and handle an empty array" do

nattswand others added2 commitsMarch 21, 2024 17:34
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
@nattswnattsw merged commitf11229a intomainMar 21, 2024
@nattswnattsw deleted the assign-false-correctly branchMarch 21, 2024 09:41
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@CvXCvXCvX approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@nattsw@CvX

[8]ページ先頭

©2009-2025 Movatter.jp