18 lines
484 B
Ruby
18 lines
484 B
Ruby
|
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
|