Sha256: 958a6eabf5f715b26c5f4702c7062d9a644d87ca6a31d1bf80fec0b579245853

Contents?: true

Size: 752 Bytes

Versions: 17

Compression:

Stored size: 752 Bytes

Contents

class BoardMessage
  
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia

  extend Enumerize

  field :name,          type: String
  field :email,         type: String
  field :message,       type: String
  field :date,          type: DateTime, default: -> { Time.now }
  field :approved,      type: String
  enumerize :approved, in: [:pending, :approved, :disapproved], default: :pending, predicates: true


  validates_presence_of :name
  validates_presence_of :email
  validates_presence_of :message
  validates_presence_of :date

  validates :email, email: true

  scope :approved, where(approved: :approved)
  scope :pending, where(approved: :pending)

  embeds_many :board_replies, cascade_callbacks: true

end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
mix-rails-0.22.0 mix-rails-message-board/app/models/board_message.rb
mix-rails-message-board-0.22.0 app/models/board_message.rb
mix-rails-0.16.0 mix-rails-message-board/app/models/board_message.rb
mix-rails-message-board-0.16.0 app/models/board_message.rb
mix-rails-0.15.0 mix-rails-message-board/app/models/board_message.rb
mix-rails-message-board-0.15.0 app/models/board_message.rb
mix-rails-0.12.2 mix-rails-message-board/app/models/board_message.rb
mix-rails-message-board-0.12.2 app/models/board_message.rb
mix-rails-0.12.1 mix-rails-message-board/app/models/board_message.rb
mix-rails-message-board-0.12.1 app/models/board_message.rb
mix-rails-0.10.4 mix-rails-message-board/app/models/board_message.rb
mix-rails-message-board-0.10.4 app/models/board_message.rb
mix-rails-0.10.3 mix-rails-message-board/app/models/board_message.rb
mix-rails-message-board-0.10.3 app/models/board_message.rb
mix-rails-message-board-0.10.2 app/models/board_message.rb
mix-rails-0.7.0 message-board/app/models/board_message.rb
mix-rails-0.6.0 message-board/app/models/board_message.rb