Class: BMC::MiniFormObject

Inherits:
SimpleDelegator
  • Object
show all
Extended by:
Forwardable
Includes:
ActiveModel::Validations
Defined in:
app/forms/bmc/mini_form_object.rb

Instance Method Summary collapse

Instance Method Details

#invalid?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'app/forms/bmc/mini_form_object.rb', line 10

def invalid?
  !valid?
end

#saveObject



22
23
24
# File 'app/forms/bmc/mini_form_object.rb', line 22

def save
  valid? && __getobj__.save
end

#save!Object



26
27
28
# File 'app/forms/bmc/mini_form_object.rb', line 26

def save!
  validate! && __getobj__.save!
end

#valid?Boolean Also known as: validate

Returns:

  • (Boolean)


5
6
7
8
# File 'app/forms/bmc/mini_form_object.rb', line 5

def valid?
  __getobj__.valid?
  run_validations!
end

#validate!Object



16
17
18
# File 'app/forms/bmc/mini_form_object.rb', line 16

def validate!
  valid? || raise_validation_error
end