This project is archived and is in readonly mode.
update_attribute is annoying, what about a bang method?
-
Pedro Axelrud
I liked the idea, very nice.
-
Rafael Souza
+1, sounds cool for me
update_attribute sometimes confuses me, I often try to pass a hash for it, mainly when I write some update_attributeS before :)
-
Juan Maiz (aka João Milho or John Corn)
The implementation also seemed very natural.
Read:
@foo.barWrite:
@foo.bar=Query:
@foo.bar?... ergo Update: @foo.bar!
... looks like the project was asking for an Update module :D
-
Rodrigo Urubatan
+1 sounds natural and it is less code to write.
-
Robson Mendonça
+1 that's a good feature, much more ruby like.
-
Nícolas Iensen
+1 less code and very intuitive
-
Corey Ward
-1
Dropping
=is actually counter-intuitive and not very Ruby-like. It's even less Rails-like.It's pretty easy to use:
@foo.bar = 'baz' and @foo.saveOr if you prefer not to have an
and(and I can't blame you):@foo.set(:bar, 'baz')Seems pretty straightforward and much shorter, plus it's just an alias for
update_attribute. -
Andrew White
- State changed from new to wontfix
- Importance changed from to Low
The consensus seems to be that it seems more like a shortcut for updates_attributes!, e.g:
def foo!(value) update_attributes!(:foo => value) endThanks for the suggestion though.
