This project is archived and is in readonly mode.
Nested attributes for ignores default scope on child model
-
Eloy Duran
- Tag changed from activerecord, default_scope, nested_attributes_for to activerecord, default_scope
- State changed from new to incomplete
It simply iterates over the association collect as it receives it from the model. So if you'd expect it to return that collection with the default scope applied, then that's what should be fixed. Ie, it's not a nested attributes issue. Could you try to isolate the issue (a failing test for the AR test suite) and edit this ticket, or create a new ticket?
I have no opinion on whether or not the default scopes should apply to these collections, I don't use them.
-
Paul Jensen
- Assigned user cleared.
Hi Eloy,
Thanks for looking at the ticket, and pointing me in the right direction. My assertion is that a default scope should filter through to all collections of a class. I must confess I'm an absolute rookie to adding tests and patches to Rails, but I'll attempt to write a test and a patch for this, and reply here.
Thanks again.
-
Mike Riley
- State changed from incomplete to resolved
- Importance changed from to
Hello Paul,
This ticket is quite old, but still wanted to check in on it. Were you able to write a test and a patch for this issue? I am going to mark this as resolved, but if you have more information or a failing test/patch we can reopen this and investigate further.
Mike Riley