Sha256: cd324b4a95f59c949ec3e7dc85acba13f41485add301b93be64519558f37f427
Contents?: true
Size: 763 Bytes
Versions: 22
Compression:
Stored size: 763 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
22 entries across 22 versions & 1 rubygems