This project is archived and is in readonly mode.
Add alternate constructor support to aggregations
-
Pratik
- State changed from new to wontfix
- Tag set to activerecord, edge, enhancement, patch, tests
You can just call parse from #initialize itself. Not convinced about the provided use case for this.
Thanks.
-
Chris Hapgood
Agreed, you can call parse from MyARModel#initialize. But that seems like a reason for scrapping aggregations entirely because you could also instantiate the composed_of objects in #initialize as well.
I would be happy to see aggregations disappear entirely -they seem like a very thin veneer on top of existing Ruby/AR constructors. But if they are worth keeping, why not make them useful for the large population of classes that use constructors like parse and from_x? The patch I propose is pretty trivial...
-
Pratik
If we have enough people asking for this, we can surely roll it in.
