|
|
@ -71,6 +71,11 @@ class RelativeMemo < ActiveRecord::Base
|
|
|
|
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
|
|
|
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def short_content(length = 25)
|
|
|
|
|
|
|
|
str = "^(.{,#{length}})[^\n\r]*.*$"
|
|
|
|
|
|
|
|
content.gsub(Regexp.new(str), '\1...').strip if content
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# def update_memos_forum
|
|
|
|
# def update_memos_forum
|
|
|
|
# if forum_id_changed?
|
|
|
|
# if forum_id_changed?
|
|
|
|
# Message.update_all({:board_id => board_id}, ["id = ? OR parent_id = ?", root.id, root.id ])
|
|
|
|
# Message.update_all({:board_id => board_id}, ["id = ? OR parent_id = ?", root.id, root.id ])
|
|
|
|