Module: AirctiveRecord::Validations

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/airctiverecord/validations.rb

Instance Method Summary collapse

Instance Method Details

#save(**options) ⇒ Object



19
20
21
22
23
# File 'lib/airctiverecord/validations.rb', line 19

def save(**options)
  return false unless valid?(new_record? ? :create : :update)

  super
end

#valid?(context = nil) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/airctiverecord/validations.rb', line 13

def valid?(context = nil)
  run_callbacks :validation do
    super
  end
end