This project is archived and is in readonly mode.
Add :writer attribute to delegate method
-
Nathan Kleyn
- Tag set to delegate method, activesupport
The diff didn't attach last round, here it is.
-
Jeff Kreeftmeijer
Hi Nathan,
Nice patch, but I don't think this would add anything that's really useful or missing right now. I'm curious about what the rest thinks, though. :)
-1
-
David Trasbo
A big -1 from here too, sorry.
Doing:
delegate :name, :name=, :to => :clientis not only shorter, it's also more readable and concise.
-
Nathan Kleyn
I did it more for situations where one would like to delegate a handful of methods, but not have to explicitly write the writer methods out:
delegate :name, :phone_number, :street, :city, :to => :client, :writer => trueIt was something that came in handy when for a large and complex API building project; we needed to keep data off a particular model acting as a tree, so we could version each node at their smaller size. It's a rather niche feature though, so I completely understand the -1's. One learns by trying though, right? =]
For all intents and purposes, :writer is only helpful when delegating multiple methods with writers.
-
Jeff Kreeftmeijer
- State changed from new to wontfix
- Importance changed from to Low
I think I understand your point, but I still think this would be better as a plugin. I'm marking this one as wontfix, keep up the great work though! :)
