This commit is contained in:
jomo
2014-04-21 01:46:31 +02:00
parent 9f120fde22
commit 67d9cbbecb
4 changed files with 4 additions and 6 deletions

View File

@@ -4,8 +4,6 @@ class Forumthread < ActiveRecord::Base
belongs_to :user_editor, class_name: "User", foreign_key: "user_editor_id"
has_many :threadreplies
validates_presence_of :title, :author, :forum
validates_presence_of :content
validates_length_of :content, in: 5..10000
@@ -37,6 +35,6 @@ class Forumthread < ActiveRecord::Base
end
def can_write?(user)
forum.can_write?(user) && (!locked? || mod?)
forum.can_write?(user) && (!locked? || user.mod?)
end
end