universal_table/app/models/column_entry.rb

21 lines
407 B
Ruby

class ColumnEntry
include Mongoid::Document
include Mongoid::Timestamps
field :text, :localize => true
field :content, :localize => true
field :date, type: DateTime
field :period_from, type: DateTime
field :period_to, type: DateTime
field :number, type: Integer
mount_uploader :image, ImageUploader
belongs_to :table_entry
belongs_to :table_column
def type
self.table_column.type
end
end