Merge branch '8-podrska-za-boje-na-kalendaru' into 'master'

Added colours for teams

Closes #8

See merge request kbr4/zsterminator!6
This commit is contained in:
2025-04-24 05:20:14 +00:00
committed by Nedim Uka
11 changed files with 313 additions and 135 deletions

View File

@@ -14,8 +14,21 @@ class ApplicationController < ActionController::Base
end
def set_company
company_id = session.fetch(:company_id, Company.first&.id)
session[:company_id] = company_id
@company = Company.find(session[:company_id])
# This should be handled by your authentication system
# But for now, we'll use a placeholder
company_id = session[:company_id]
unless company_id && Company.exists?(company_id)
# If no company in session or it doesn't exist, use the first company
company_id = Company.first&.id
session[:company_id] = company_id
end
@company = Company.find(company_id) if company_id
end
def current_company
@company
end
helper_method :current_company
end