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

Fixes #18: by including a reference to a collections parent_id if pre… #19

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dawilster
Copy link

…sent

dawilster and others added 6 commits March 21, 2016 17:34
…t/:parent_id/child.parent_id/import_csv explicitly requiring the parents id seems to fix it
…resource Class. This way admin resources they use belongs_to relations can build through the parent chain
…acks aren't supported we needed a way to tap the resource before it was saved.
…tive_admin_csv_import into fix/parent-collection-path
resource ||= build_row_resource

# controller before create callback
resource = before_create(resource) if respond_to? :before_create
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this happen as part of build_row_resource?

@dawilster
Copy link
Author

@tspacek could I get your thoughts on this?

@tspacek
Copy link
Member

tspacek commented Mar 23, 2016

Looks reasonable.

@@ -87,6 +88,12 @@ def update_row_resource(resource, params)
resource.save
end

def build_row_resource
resource = end_of_association_chain.new
Copy link
Member

Choose a reason for hiding this comment

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

Does build work here instead of new? Might be a bit more idiomatic.

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

Successfully merging this pull request may close these issues.

3 participants