Sha256: 886d26833e3391a05bbf0fb953de21763846ca7cd6b23d6b149aa561a7d94c9d
Contents?: true
Size: 588 Bytes
Versions: 10
Compression:
Stored size: 588 Bytes
Contents
module DataCatalog class Categorization include MongoMapper::Document # == Attributes key :source_id, ObjectId key :category_id, ObjectId timestamps! # == Indices # == Associations belongs_to :source, :class_name => 'DataCatalog::Source' belongs_to :category, :class_name => 'DataCatalog::Category' # == Validations validate :validate_associations def validate_associations errors.add(:source_id, "must be valid") if source.nil? errors.add(:category_id, "must be valid") if category.nil? end end end
Version data entries
10 entries across 10 versions & 1 rubygems