mardi 14 juillet 2015

Method similar to update_attribute or update_column for rails 3

In my Report and I have a few attributes serialized which on update_attributes method call, updates all the serialized fields, which I don't want.

Although result is same but a round trip isn't a good thing I believe.

Some code:

def set_failed    
  self.update_attributes(:status => FAILURE)
end

Report.set_failed does update the existing serialized fields defined in Report class

Is there any other method in rails or a solution that's efficient for this?

rails 3.2.22

Aucun commentaire:

Enregistrer un commentaire