Module | ActiveLdap::Attributes |
In: |
lib/active_ldap/attributes.rb
|
# File lib/active_ldap/attributes.rb, line 3 3: def self.included(base) 4: base.class_eval do 5: extend(ClassMethods) 6: extend(Normalizable) 7: include(Normalizable) 8: end 9: end
# File lib/active_ldap/attributes.rb, line 159 159: def attributes_protected_by_default 160: _dn_attribute = nil 161: begin 162: _dn_attribute = dn_attribute_with_fallback 163: rescue DistinguishedNameInvalid 164: end 165: [_dn_attribute, 'objectClass'].compact 166: end
# File lib/active_ldap/attributes.rb, line 168 168: def normalize_attribute_name(name) 169: self.class.normalize_attribute_name(name) 170: end
# File lib/active_ldap/attributes.rb, line 145 145: def remove_attributes_protected_from_mass_assignment(targets) 146: needless_attributes = {} 147: (attributes_protected_by_default + 148: (self.class.protected_attributes || [])).each do |name| 149: needless_attributes[to_real_attribute_name(name)] = true 150: end 151: 152: targets.collect do |key, value| 153: [to_real_attribute_name(key) || key, value] 154: end.reject do |key, value| 155: needless_attributes[key] 156: end 157: end