socialforge/app/models/memo.rb

18 lines
484 B
Ruby
Raw Normal View History

2013-11-22 21:55:21 +08:00
class Memo < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :forums
belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
safe_attributes "author_id",
"subject",
"content",
"forum_id",
"last_reply_id",
"lock",
"parent_id",
"replies_count",
"sticky"
validates_presence_of :author_id, :content, :forum_id, :subject
validates_length_of :subject, maximum: 50
validates_length_of :content, maximum: 2048
end