Restoring Associations #16

Closed
adrianpike opened this Issue Jan 20, 2011 · 5 comments

Comments

Projects
None yet
3 participants

Dependent associations that get archived aren't restored automatically.

Owner

winton commented Jan 20, 2011

I've tested every kind of Rails associations in the specs. Must be missing something. Could you provide code examples of what isn't working?

Whala!

https://gist.github.com/787267

It might be the :quick, now that I've got mover patched to work with sqlite I'll try pulling that and see if it changes anything.

edit: Nope, removing :quick doesn't help. I'm on Rails 3.0.3, FWIW.
edit2: aha! https://gist.github.com/787274

Got it - acts_as_archive was above my association definitions, so at the time that the subclass was defined, the inheritable_attribute for reflections was empty.

Probably worth mentioning it in a gotchas or in the readme. I'll try and think about any clever solution that can be done on a_a_a's end.

Owner

winton commented Jan 21, 2011

Ah, yes, I had come across that as well but had totally forgotten. Thanks for the reminder, adding to readme.

cwade commented Apr 18, 2011

I think I'm seeing this issue again now that the syntax has changed so that the acts_as_archive declaration isn't made explicitly. Any suggestions? (I tried explicitly adding the declaration, but my archive model still returns [] for reflect_on_all_associations).

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment