require 'scrivito/workspace' module Scrivito class Workspace # there are no outdated workspaces def outdated? false end # properly handle the only two workspaces def self.use(id_or_title) self.current = if id_or_title =~ /(published|rtc)/ find(id_or_title) else find_by_title(id_or_title) or raise ResourceNotFound, "Could not find #{self} with title #{id_or_title}" end rescue ResourceNotFound raise ResourceNotFound, %{Could not find #{self} with title or ID "#{id_or_title}"} end end end