Sha256: 2e7f80bcbf1ea524ac8f3c72e6fe22cddb0fc935a815b1a3b248b6f06775bd30

Contents?: true

Size: 515 Bytes

Versions: 1

Compression:

Stored size: 515 Bytes

Contents

# == Schema Information
#
# Table name: comments
#
#  id         :integer          not null, primary key
#  finish_id  :integer          not null
#  user_id    :integer          not null
#  body       :text
#  created_at :datetime
#  updated_at :datetime
#

class Comment < ActiveRecord::Base
  belongs_to :finish, counter_cache: true
  belongs_to :user

  validates :finish, presence: true
  validates :user, presence: true
  validates :body, presence: true

  def updated?
    created_at != updated_at
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
self_systeem-0.1.0 test/dummy_app/app/models/comment.rb