Module: NinjaModel::Validation
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Validations
- Included in:
- Base
- Defined in:
- lib/ninja_model/validation.rb
Instance Method Summary collapse
Instance Method Details
#save(options = {}) ⇒ Object
11 12 13 |
# File 'lib/ninja_model/validation.rb', line 11 def save(={}) perform_validations() ? super : false end |
#valid?(context = nil) ⇒ Boolean
15 16 17 18 19 |
# File 'lib/ninja_model/validation.rb', line 15 def valid?(context = nil) context ||= (persisted? ? :update : :create) output = super(context) errors.empty? && output end |