Module: AdvancedRelationshipManagement::LazyLoading

Extended by:
ActiveSupport::Concern
Defined in:
lib/advanced_relationship_management/lazy_loading.rb

Instance Method Summary collapse

Instance Method Details

#lazy_ancestorsObject



14
15
16
# File 'lib/advanced_relationship_management/lazy_loading.rb', line 14

def lazy_ancestors
  self.class.lazy_load_parent.where("#{self.class.child_column_name} = ?", self.id)
end

#lazy_descendantsObject



10
11
12
# File 'lib/advanced_relationship_management/lazy_loading.rb', line 10

def lazy_descendants
  self.class.lazy_load_children.where("#{self.class.parent_column_name} = ?", self.id)
end