Module: ActiveRecordCompose::Validations
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Validations::Callbacks
- Included in:
- Model
- Defined in:
- lib/active_record_compose/validations.rb
Instance Method Summary collapse
- #save(**options) ⇒ void
- #save!(**options) ⇒ void
-
#valid?(context = nil) ⇒ Boolean
Runs all the validations and returns the result as true or false.
-
#validate(context = nil) ⇒ Boolean
Alias for #valid?.
-
#validate!(context = nil) ⇒ void
Runs all the validations within the specified context.
Instance Method Details
#save(**options) ⇒ void
16 17 18 |
# File 'lib/active_record_compose/validations.rb', line 16 def save(**) perform_validations() ? super : false end |
#save!(**options) ⇒ void
20 21 22 |
# File 'lib/active_record_compose/validations.rb', line 20 def save!(**) perform_validations() ? super : raise_validation_error end |
#valid?(context = nil) ⇒ Boolean
Runs all the validations and returns the result as true or false.
28 |
# File 'lib/active_record_compose/validations.rb', line 28 def valid?(context = nil) = context_for_override_validation.with_override(context) { super } |
#validate(context = nil) ⇒ Boolean
Alias for #valid?
|
|
# File 'lib/active_record_compose/validations.rb', line 30
|
#validate!(context = nil) ⇒ void
Runs all the validations within the specified context.
no errors are found, raises ActiveRecord::RecordInvalid otherwise.
|
|
# File 'lib/active_record_compose/validations.rb', line 36
|