-
Notifications
You must be signed in to change notification settings - Fork 614
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
Recursively import all has_one/has_many associations #230
Conversation
7b9b676
to
e0002ec
Compare
e0004e0
to
e0006a5
Compare
@@ -462,7 +461,7 @@ def import_associations(models, options) | |||
def find_associated_objects_for_import(associated_objects_by_class, model) | |||
associated_objects_by_class[model.class.name]||={} | |||
|
|||
model.class.reflect_on_all_autosave_associations.each do |association_reflection| | |||
model.class.reflect_on_all_associations(:has_many).each do |association_reflection| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might need to be revised to include :has_one associations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That can be added once #234 is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 |
e0006a5
to
2aca18b
Compare
@zdennis I just rebased this branch from |
Awesome! Thanks @sferik! |
@zdennis As you’re well aware, the tests are failing due to an issue with At this point, I think dropping support for |
This has been included in the 0.12.0 release. |
This should work for all
has_one
/has_many
associations, not just ones explicitly markedautosave
.