Sha256: e4cd720a4868da1015041a669549568fd5b4783957243f0851867de8969a7752

Contents?: true

Size: 659 Bytes

Versions: 4

Compression:

Stored size: 659 Bytes

Contents

module OpenConferenceWare

  # == Schema Information
  #
  # Table name: comments
  #
  #  id          :integer          not null, primary key
  #  name        :string(255)
  #  email       :string(255)
  #  message     :text
  #  proposal_id :integer
  #  created_at  :datetime
  #  updated_at  :datetime
  #

  class Comment < OpenConferenceWare::Base
    belongs_to :proposal

    validates_presence_of :email, :message, :proposal_id

    # Make sure there's a legitimate proposal attached?!
    validates_presence_of :proposal, message: "must be present"

    scope :listable, lambda { order("created_at desc").where("created_at IS NOT NULL") }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
open_conference_ware-1.0.0.pre4 app/models/open_conference_ware/comment.rb
open_conference_ware-1.0.0.pre3 app/models/open_conference_ware/comment.rb
open_conference_ware-1.0.0.pre2 app/models/open_conference_ware/comment.rb
open_conference_ware-1.0.0.pre1 app/models/open_conference_ware/comment.rb