-
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
Cannot use ActiveRecord helper to create associated model from parent model record #192
Comments
@mghadley I think I'm misunderstanding what it is you are doing (or there is a difference between our environments that causes this), as I'm not able to reproduce this error. I've added a couple of tests in https://github.com/googleapis/ruby-spanner-activerecord/pull/197/files to simulate this, both for interleaved tables and normal relations, but they seem to work. Would you mind adding a more elaborate example of how this goes wrong for you? Or in any other way point me in the right direction for how I can reproduce this? |
Hi @olavloite, sorry for the slow response. I was able to narrow down the situation in which this is happening. A simplified version of our code with the relevant pieces is below. With this setup, this fails: Migration:
Account model:
Transaction model:
|
@mghadley I've been trying to reproduce this with our standard test cases for interleaved tables. These also include an interleaved table structure with multiple layers, but also in this case I'm not able to reproduce the issue that you are seeing. See the test case in #223 (Specifically this line). Do you have any clues for me what I need to change in that test case to get the same error as you are getting? |
Environment details
Steps to reproduce
parent_model.child_models.create()
Whenever I do this I get this error:
google-cloud-ruby/google-cloud-spanner/lib/google/cloud/spanner/convert.rb:120:in field_for_object': ArgumentError: Cannot determine type for nil values. (ActiveRecord::StatementInvalid)
The text was updated successfully, but these errors were encountered: