Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Datamapper compatibility #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

shingara
Copy link

Datamapper is not compatible to nested_form.

To have the accepts_nested_attributes_for in Datamapper you need use the gem : dm-accepts_nested_attributes.

But if you use it, nested_form is not compatible because 2 problems :

1. reflect_on_association

This method is not design in Datamapper. You need use the klass.repository[association].target_model instead.

2. _destroy is not define

In this gem the attribute to mark a record destroy is _delete instead of _destroy on ActiveRecord. And there are no method _destroy or _delete in the instance to check if this object can be delete or not in futur.

This pull request help to work DataMapper and nested_form together. But actually, it's not compatible to ActiveRecord anymore. I can do the job to be compatible both. But I prefer start avoid it in first and do the job if needed.

@shingara
Copy link
Author

Spec failed because this incompatibility.

@lest
Copy link
Collaborator

lest commented Sep 17, 2012

I think we should think about extracting ActiveRecord dependent code into a module at first. Then we could easily add DataMapper or any other ORM compatibility.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants