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

Why do my objects only contain ID strings after transmitting via gon? #266

Open
asfarley opened this issue Jan 25, 2021 · 2 comments
Open

Comments

@asfarley
Copy link

I'm having a strange problem: previously, the gon gem was working for me to pass an array of objects to the browser. Here's the assignment:

gon.frames = @job.sequence.frames.sort_by(&:n)

Previously, this assignment resulted in the gon.frames variable containing a list of Javascript dictionaries/objects:

{id: 11, user_id: 12, sequence_id: 13, sequence_list_id: 3, complete: false, …}

Now, it contains only an ActiveRecord ID or something like that:

"#<Frame:0x00007f25035e47d0>"

I've made some changes in my code, mainly running bundle update and things like that, but nothing that would intentionally change how this work. However, there was a wide enough set of changes from updating the gems that it's hard to isolate the source of this change.

Is gon responsible for deciding how to convert something into Javascript? What would cause gon to convert into the format that only includes an identifier, rather than the dictionary of values?

@asfarley
Copy link
Author

Am I understanding the CI test results correctly? It looks like this gem isn't passing for any rubies beyond 2.4.10

@asfarley
Copy link
Author

Not sure what was happening here, but I rolled back to ruby 2.6.1 and it seemed to fix my problems.

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

No branches or pull requests

1 participant