
class ApplicationController < ActiveSomethinghelper_method :intranetdef intranet@intranet ||= Intranet.new(current_user)endend
class DashboardControllerhelper_method :dashboarddef dashboard@dashboard ||= intranet.dashboardenddef show@visits = dashboard.visits.paginate ...endend
class Intranetdef dashboard; @dashboard ||= Dashboard.newendclass Dashboarddef stats@stats ||= DashboardStats.newendend
class FilesController < ApplicationControllerdef new@form_model = intranet.files.formendend
class Intranetdef initialize(user)@employee = userenddef files@files ||= if user.is_a?(Admin)FilesManager.newelseFilesViewer.newendendend
class FilesViewerdef files_listendendclass FilesBrowser < FilesViewerdef upload_file(file)enddef remove_file(filename)endend