notebook/app/models/folder.rb
Andrew Brown da3475c2c0 Fix test failures and enhance document revision functionality
- Fix root URL redirect expectations (now redirects to /my/dashboard instead of /my/content)
- Fix Timeline authorizer to allow universe contributors to edit shared timelines
- Add comprehensive document revision UI with version history and comparison
- Enhance document revision controller with proper permissions and navigation
- Add document folder association and improved folder management
- Update development environment for better debugging with Spring watcher
- Add development tools (bin/dev-restart script, Spring configuration)

Tests: Fixed 5 failures, all pinning tests pass

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-15 15:57:03 -07:00

31 lines
543 B
Ruby

class Folder < ApplicationRecord
has_many :documents
belongs_to :parent_folder, optional: true, class_name: Folder.name, foreign_key: :parent_folder_id
belongs_to :user
def child_folders
Folder.where(user: self.user, context: self.context, parent_folder_id: self.id)
end
def self.color
'bg-blue-600'
end
def self.hex_color
'#0000ff'
end
def self.text_color
'text-blue-600'
end
def self.icon
'folder'
end
def to_param
self.id.to_s + '-' + PageTagService.slug_for(self.title)
end
end