Sha256: 3e0e943a866ecd8f9d1e16e0654824e4596d2700bda4073070d1f7623b5bdc90

Contents?: true

Size: 750 Bytes

Versions: 3

Compression:

Stored size: 750 Bytes

Contents

module DataCatalog

  class Sources < Base
    include Resource

    model Source

    # == Permissions

    roles Roles
    permission :list   => :basic
    permission :read   => :basic
    permission :create => :curator
    permission :update => :curator
    permission :delete => :curator

    # == Properties

    property :title
    property :url
    property :raw, :w => :admin, :hide_by_default => true

    property :categories do |source|
      source.categorizations.map do |categorization|
        {
          "id"   => categorization.category.id,
          "href" => "/categories/#{categorization.category.id}",
          "name" => categorization.category.name,
        }
      end
    end

    # == Callbacks
  end

  Sources.build

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sinatra_resource-0.4.24 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.23 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.22 examples/datacatalog/resources/sources.rb