-
Notifications
You must be signed in to change notification settings - Fork 35
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
Attrribute methods not running #73
Comments
Hi @PhilCoggins , I don't think this can issue can be because of how gems are installed on your system. Can you try and create minimal reproduction of your code using https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb - schema, serializers and create an object that has bad serialization and I'll try to reproduce it as well? |
Hi @yosiat thank you for the speedy response. The containers are identical AFAICT, and the test case is the exact same and data is returned as expected, but somehow the attribute methods are not being called (though the standard attribute methods are). I've been working on a reliable reproduction, I will update this issue as soon as I get one. |
@yosiat You are correct, this was not an issue with gem installation. My To be honest, I have no idea how my autoloader (Zeitwerk) resolves this, but the reason this was intermittent is because the load order of the files was inconsistent between containers. If the My "fix" was to move the I think this could be made more reliable. When you define relationships on an ActiveRecord model, they allow you to pass an argument Would you consider supporting a similar API that uses I wrote a test script which helped me identify this issue, but it's not a true repro as these single-file test scrips don't load classes and files in the same manner as would happen in a Rails environment. If you need I'd be happy to push a sample Rails app to demo this issue. |
@PhilCoggins sorry for replying one year later! I implemented your suggestion here - #108, I hope it will solve this issue with circular dependency you have. If you can run you tests with this branch and let me know if it solves the issue it will be amazing. |
Posted this one to Slack, but haven't noticed activity there in a few months so reposting into an issue for brevity. Using latest tag
0.7.3
, Ruby 2.6.6.I've been beating my head against an issue all day long that I just can't figure out. I'm looking for some guidance or tips on how to debug this.
Panko is serializing json differently between different containers on both CircleCI and Heroku Production. I have three Serializers, one of them (
ContactSerializer
) is returning nil instead of the result of the method:In some containers, it is returning
{:contact=>{:full_name=>nil, :id=>131, :photo_url=>nil}
and in other containers, it returns valid values forfull_name
andphoto_url
. On the failing containers, I can comment outhas_one :user, serializer: UserSerializer
and it works fine, but why would this behavior be different on identical environments?My best hunch right now is that there is a race condition when my gems are installed with
bundle install --jobs=4
, possible that Panko native extensions are conflicting with another library? Again, just need some direction on how to troubleshoot this. I have tried to reinstall gems without concurrent install withbundle install --force
, but this does not resolve the issue on the failed containers. Any help would be much appreciated!The text was updated successfully, but these errors were encountered: