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.24 examples/datacatalog/models/category.rb
sinatra_resource-0.4.23 examples/datacatalog/models/category.rb
sinatra_resource-0.4.22 examples/datacatalog/models/category.rb
sinatra_resource-0.4.21 examples/datacatalog/models/category.rb
sinatra_resource-0.4.20 examples/datacatalog/models/category.rb
sinatra_resource-0.4.19 examples/datacatalog/models/category.rb
sinatra_resource-0.4.18 examples/datacatalog/models/category.rb
sinatra_resource-0.4.17 examples/datacatalog/models/category.rb
sinatra_resource-0.4.16 examples/datacatalog/models/category.rb
sinatra_resource-0.4.15 examples/datacatalog/models/category.rb
sinatra_resource-0.4.14 examples/datacatalog/models/category.rb
sinatra_resource-0.4.13 examples/datacatalog/models/category.rb
sinatra_resource-0.4.12 examples/datacatalog/models/category.rb
sinatra_resource-0.4.11 examples/datacatalog/models/category.rb
sinatra_resource-0.4.10 examples/datacatalog/models/category.rb
sinatra_resource-0.4.9 examples/datacatalog/models/category.rb
sinatra_resource-0.4.8 examples/datacatalog/models/category.rb
sinatra_resource-0.4.7 examples/datacatalog/models/category.rb
sinatra_resource-0.4.6 examples/datacatalog/models/category.rb
sinatra_resource-0.4.5 examples/datacatalog/models/category.rb