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

#saveObject



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

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

#save!Object



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

def save!(*)
  valid? ? 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