Class: SeaFood::Form

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/sea_food/form.rb

Instance Method Summary collapse

Instance Method Details

#save(options = {}) ⇒ Object



9
10
11
# File 'lib/sea_food/form.rb', line 9

def save(options = {})
  model.save(**options) if valid?
end

#save!(options = {}) ⇒ Object



13
14
15
# File 'lib/sea_food/form.rb', line 13

def save!(options = {})
  model.save!(**options) if valid?
end

#validate(options = {}) ⇒ Object



5
6
7
# File 'lib/sea_food/form.rb', line 5

def validate(options = {})
  valid? && validate_model(options)
end