Class: BMC::MiniFormObject
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- BMC::MiniFormObject
- Extended by:
- Forwardable
- Includes:
- ActiveModel::Validations
- Defined in:
- app/forms/bmc/mini_form_object.rb
Instance Method Summary collapse
- #invalid? ⇒ Boolean
- #save ⇒ Object
- #save! ⇒ Object
- #valid? ⇒ Boolean (also: #validate)
- #validate! ⇒ Object
Instance Method Details
#invalid? ⇒ Boolean
10 11 12 |
# File 'app/forms/bmc/mini_form_object.rb', line 10 def invalid? !valid? end |
#save ⇒ Object
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
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 |