Skip to content

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

Open
dawilster wants to merge 7 commits into
masterfrom
fix/parent-collection-path
Open

Fixes #18: by including a reference to a collections parent_id if pre…#19
dawilster wants to merge 7 commits into
masterfrom
fix/parent-collection-path

Conversation

@dawilster

Copy link
Copy Markdown

…sent

dawilsterand 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
Comment threadlib/active_admin_csv_import/dsl.rb Outdated
resource ||= build_row_resource

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

Copy link
Copy Markdown
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
Copy Markdown
Author

@tspacek could I get your thoughts on this?

@tspacek

Copy link
Copy Markdown
Member

Looks reasonable.

end

def build_row_resource
resource = end_of_association_chain.new

Copy link
Copy Markdown
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 freeto 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

@dawilster@tspacek@antonivanopoulos