Module: Sunrise::NestedSet::Depth::InstanceMethods

Defined in:
lib/sunrise/nested_set/depth.rb

Instance Method Summary collapse

Instance Method Details

#depth?Boolean

Check is model has depth column

Returns:

  • (Boolean)


39
40
41
# File 'lib/sunrise/nested_set/depth.rb', line 39

def depth?
  self.class.depth?
end

#update_depthObject

Update cached_level attribute



44
45
46
# File 'lib/sunrise/nested_set/depth.rb', line 44

def update_depth
  update_attribute(:depth, level)
end