Module: ActiveLdap::Associations
- Defined in:
- lib/active_ldap/associations.rb
Overview
Associations
Associations provides the class methods needed for the extension classes to create methods using belongs_to and has_many
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.append_features(base) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/active_ldap/associations.rb', line 14 def self.append_features(base) super base.extend(ClassMethods) base.class_inheritable_array(:associations) base.associations = [] end |
Instance Method Details
#clear_association_cache ⇒ Object
195 196 197 198 199 200 |
# File 'lib/active_ldap/associations.rb', line 195 def clear_association_cache return if new_record? (self.class.associations || []).each do |association| instance_variable_set("@#{association}", nil) end end |