Module: ActiveLdap::Validations — activeldap - ActiveLdap

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

- (Object) save



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

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

- (Object) save!



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

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

- (Boolean) valid?(context = nil)

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

- (Object) validation_skip_attributes



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

def validation_skip_attributes
  @validation_skip_attributes ||= []
end

- (Object) validation_skip_attributes=(attributes)



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

def validation_skip_attributes=(attributes)
  @validation_skip_attributes = attributes
end