Method: MiniForm::Model#update

Defined in:
lib/mini_form/model.rb

#update(attributes = {}) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/mini_form/model.rb', line 61

def update(attributes = {})
  self.attributes = attributes unless attributes.empty?

  return false unless valid?

  run_callbacks :update do
    transaction do
      save_models
      perform
    end
  end

  true
end