Module: ActiveLdap::Validations

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Validations
Defined in:
lib/active_ldap/validations.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#save(**options) ⇒ Object



56
57
58
# File 'lib/active_ldap/validations.rb', line 56

def save(**options)
  perform_validations(options) ? super : false
end

#save!(**options) ⇒ Object



60
61
62
# File 'lib/active_ldap/validations.rb', line 60

def save!(**options)
  perform_validations(options) ? super : raise(EntryInvalid.new(self))
end

#valid?(context = nil) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
53
54
# File 'lib/active_ldap/validations.rb', line 50

def valid?(context = nil)
  context ||= (new_entry? ? :create : :update)
  output = super(context)
  errors.empty? && output
end

#validation_skip_attributesObject



42
43
44
# File 'lib/active_ldap/validations.rb', line 42

def validation_skip_attributes
  @validation_skip_attributes ||= []
end

#validation_skip_attributes=(attributes) ⇒ Object



46
47
48
# File 'lib/active_ldap/validations.rb', line 46

def validation_skip_attributes=(attributes)
  @validation_skip_attributes = attributes
end