module ActiveLdap::Validations

Public Class Methods

human_attribute_name_with_gettext(attribute_key_name, options={}) click to toggle source
# File lib/active_ldap/validations.rb, line 10
def human_attribute_name_with_gettext(attribute_key_name, options={})
  logger.warn("options was ignored.") unless options.empty?
  s_("#{self}|#{attribute_key_name.to_s.humanize}")
end

Public Instance Methods

save(*) click to toggle source
# File lib/active_ldap/validations.rb, line 43
def save(*)
  valid? ? super : false
end
save!(*) click to toggle source
# File lib/active_ldap/validations.rb, line 47
def save!(*)
  valid? ? super : raise(EntryInvalid.new(self))
end
valid?(context = nil) click to toggle source
# 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_attributes() click to toggle source
# File lib/active_ldap/validations.rb, line 29
def validation_skip_attributes
  @validation_skip_attributes ||= []
end
validation_skip_attributes=(attributes) click to toggle source
# File lib/active_ldap/validations.rb, line 33
def validation_skip_attributes=(attributes)
  @validation_skip_attributes = attributes
end