Module: ActiveLdap::Validations

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

Instance Method Summary collapse

Instance Method Details

#saveObject



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

def save(*)
  valid? ? super : false
end

#save!Object



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

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

#valid?(context = nil) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
40
41
# File 'lib/active_ldap/validations.rb', line 37

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

#validation_skip_attributesObject



29
30
31
# File 'lib/active_ldap/validations.rb', line 29

def validation_skip_attributes
  @validation_skip_attributes ||= []
end

#validation_skip_attributes=(attributes) ⇒ Object



33
34
35
# File 'lib/active_ldap/validations.rb', line 33

def validation_skip_attributes=(attributes)
  @validation_skip_attributes = attributes
end