Class: SettingAccessors::IntegrationValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/setting_accessors/integration_validator.rb

Overview

This class handles model validations for assigned records, e.g. if the settings are accessed using the Accessor class in this module. Only the new temp values are validated using the setting config.

The main work is still done in the Accessor class, so we don’t have to access its instance variables here, this class acts as a wrapper for Rails’ validation chain

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



12
13
14
# File 'lib/setting_accessors/integration_validator.rb', line 12

def validate(record)
  record.settings.send(:validate!)
end