Sha256: 26aa6a70eb92005d02729133bd75e47223dce71c8f778718ac3271c50205f386

Contents?: true

Size: 503 Bytes

Versions: 3

Compression:

Stored size: 503 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

  accepts_nested_attributes_for :comments, :reject_if => :all_blank

  lolita
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lolita-3.1.4 spec/rails_app/app/mongoid/post.rb
lolita-3.1.3 spec/rails_app/app/mongoid/post.rb
lolita-3.1.2 spec/rails_app/app/mongoid/post.rb