Sha256: 1d81cacd049a827505f3fd34fc5423107ab9dc1544626123917a334f9dfca215
Contents?: true
Size: 770 Bytes
Versions: 13
Compression:
Stored size: 770 Bytes
Contents
class Post include Mongoid::Document include Lolita::Configuration field :title, type: String field :body, type: String field :is_public, type: Boolean field :price, type: BigDecimal field :published_at, type: DateTime, default: -> { Time.now } field :expire_date, type: Date belongs_to :category has_and_belongs_to_many :tags has_many :comments belongs_to :profile validates_presence_of :title default_scope -> { order_by([:title, :asc]) } accepts_nested_attributes_for :comments, :reject_if => :all_blank lolita do list do column :comments do list do column :body end end end end def self.custom_search query,request=nil,dbi=nil self.where(:expire_date.gt => Date.today) end end
Version data entries
13 entries across 13 versions & 1 rubygems