fixes #139: New forum threads submitted locked/stickied are neither.

This commit is contained in:
albert
2011-10-17 00:13:36 -04:00
parent 3feeaf02e3
commit eee3351c0f
5 changed files with 31 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
class ForumTopic < ActiveRecord::Base
attr_accessible :title, :original_post_attributes
attr_accessible :is_sticky, :is_locked, :as => :janitor
belongs_to :creator, :class_name => "User"
belongs_to :updater, :class_name => "User"
has_many :posts, :class_name => "ForumPost", :order => "forum_posts.id asc", :foreign_key => "topic_id", :dependent => :destroy

View File

@@ -199,6 +199,28 @@ class User < ActiveRecord::Base
end
end
def role
case level
when Levels::MEMBER
:member
when Levels::PRIVILEGED
:privileged
when Levels::CONTRIBUTOR
:contributor
when Levels::JANITOR
:janitor
when Levels::MODERATOR
:moderator
when Levels::ADMIN
:admin
end
end
def level_string
case level
when Levels::MEMBER