Sha256: 1fbf36b04556e3a68ff984751a75c45cb46d2f463d3755f0be2a62eeb7115f47

Contents?: true

Size: 581 Bytes

Versions: 3

Compression:

Stored size: 581 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/scrivito_patches/workspace.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/scrivito_patches/workspace.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/scrivito_patches/workspace.rb