app/models/directory.rb
def _validate_same_user_as_parent
    if parent != nil && parent.user_id != user_id
      errors.add(:parent, 'directory must have a parent that is part of the same user\'s tree')
    end
  end
# A directory can contains other directories as well as files
# Deleting is recursive
A directory can contains other directories as well as files
Deleting is recursive
A directory can contains other directories as well as files Deleting is recursive
def _validate_same_user_as_parent
    if parent != nil && parent.user_id != user_id
      errors.add(:parent, 'directory must have a parent that is part of the same user\'s tree')
    end
  end
def _validate_same_user_as_parent if parent != nil && parent . user_id != user_id errors . add ( :parent , 'directory must have a parent that is part of the same user\'s tree' ) end end
A directory can contains other directories as well as files
Deleting is recursive
A directory can contains other directories as well as files Deleting is recursive