Sha256: 479e37f6760fd0fc69833da309e5c55552f80ccadf8a7d160a2e96eb4f84f1b1

Contents?: true

Size: 456 Bytes

Versions: 1

Compression:

Stored size: 456 Bytes

Contents

require "active_record"

class Comment < ActiveRecord::Base
	set_table_name :wp_comments
	set_primary_key :comment_ID
	
	belongs_to :page_post
	belongs_to :user
	
	validates_presence_of :comment_post_ID
	
	before_create :set_default_values
	
	def set_default_values
		t = Time.now
		self.comment_date = t
		self.comment_date_gmt = t.gmtime
	end
	
	def content
		comment_content
	end
	
	def content= new_content
		self.comment_content = new_content
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wpb-0.0.3 lib/wpb/comment.rb