Loading...

WellRailed@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

[WellRailed] A question of style Henry Maddocks Thu Feb 02 16:09:39 2012

Something that has bothered me for a while is should model methods that set 
attributes call save or should the caller do it?

ie. This...

class Project < ActiveRecord::Base
  def paid
    self.state = PAID
    self.save
  end

end

or this...

my_project.paid
my_project.save


-- 
You received this message because you are subscribed to the Google Groups 
"WellRailed" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/wellrailed?hl=en.