Sha256: 0c6f869963a32fda229159d02df416f745e4c9a485234d3c6f592f68b07b9b42

Contents?: true

Size: 439 Bytes

Versions: 26

Compression:

Stored size: 439 Bytes

Contents

module DataCatalog

  class Category

    include MongoMapper::Document

    # == Attributes

    key :name, String
    key :log,  String
    timestamps!

    # == Indices

    # == Associations

    many :categorizations,
      :class_name  => 'DataCatalog::Categorization',
      :foreign_key => :category_id

    def sources
      categorizations.map(&:source)
    end

    # == Validations

    validates_presence_of :name

  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
sinatra_resource-0.4.4 examples/datacatalog/models/category.rb
sinatra_resource-0.4.3 examples/datacatalog/models/category.rb
sinatra_resource-0.4.2 examples/datacatalog/models/category.rb
sinatra_resource-0.4.1 examples/datacatalog/models/category.rb
sinatra_resource-0.4.0 examples/datacatalog/models/category.rb
sinatra_resource-0.3.6 examples/datacatalog/models/category.rb