fixes #779
This commit is contained in:
@@ -11,7 +11,7 @@ class Artist < ActiveRecord::Base
|
|||||||
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
||||||
has_one :tag_alias, :foreign_key => "antecedent_name", :primary_key => "name"
|
has_one :tag_alias, :foreign_key => "antecedent_name", :primary_key => "name"
|
||||||
accepts_nested_attributes_for :wiki_page
|
accepts_nested_attributes_for :wiki_page
|
||||||
attr_accessible :body, :name, :url_string, :other_names, :other_names_comma, :group_name, :wiki_page_attributes, :notes, :is_active, :as => [:member, :privileged, :platinum, :contributor, :janitor, :moderator, :default, :admin]
|
attr_accessible :body, :name, :url_string, :other_names, :other_names_comma, :group_name, :wiki_page_attributes, :notes, :is_active, :as => [:member, :privileged, :builder, :platinum, :contributor, :janitor, :moderator, :default, :admin]
|
||||||
attr_accessible :is_banned, :as => :admin
|
attr_accessible :is_banned, :as => :admin
|
||||||
|
|
||||||
module UrlMethods
|
module UrlMethods
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class ForumPost < ActiveRecord::Base
|
class ForumPost < ActiveRecord::Base
|
||||||
attr_accessible :body, :topic_id, :as => [:member, :privileged, :platinum, :contributor, :janitor, :admin, :moderator, :default]
|
attr_accessible :body, :topic_id, :as => [:member, :builder, :privileged, :platinum, :contributor, :admin, :moderator, :default]
|
||||||
attr_accessible :is_locked, :is_sticky, :is_deleted, :as => [:admin, :moderator]
|
attr_accessible :is_locked, :is_sticky, :is_deleted, :as => [:admin, :moderator, :janitor]
|
||||||
belongs_to :creator, :class_name => "User"
|
belongs_to :creator, :class_name => "User"
|
||||||
belongs_to :topic, :class_name => "ForumTopic"
|
belongs_to :topic, :class_name => "ForumTopic"
|
||||||
before_validation :initialize_creator, :on => :create
|
before_validation :initialize_creator, :on => :create
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class ForumTopic < ActiveRecord::Base
|
class ForumTopic < ActiveRecord::Base
|
||||||
attr_accessible :title, :original_post_attributes, :as => [:member, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
attr_accessible :title, :original_post_attributes, :as => [:member, :builder, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
||||||
attr_accessible :is_sticky, :is_locked, :is_deleted, :as => [:janitor, :admin, :moderator]
|
attr_accessible :is_sticky, :is_locked, :is_deleted, :as => [:janitor, :admin, :moderator]
|
||||||
belongs_to :creator, :class_name => "User"
|
belongs_to :creator, :class_name => "User"
|
||||||
belongs_to :updater, :class_name => "User"
|
belongs_to :updater, :class_name => "User"
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ class Post < ActiveRecord::Base
|
|||||||
validates_uniqueness_of :md5
|
validates_uniqueness_of :md5
|
||||||
validates_presence_of :parent, :if => lambda {|rec| !rec.parent_id.nil?}
|
validates_presence_of :parent, :if => lambda {|rec| !rec.parent_id.nil?}
|
||||||
# validate :validate_parent_does_not_have_a_parent
|
# validate :validate_parent_does_not_have_a_parent
|
||||||
attr_accessible :source, :rating, :tag_string, :old_tag_string, :last_noted_at, :parent_id, :as => [:member, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
attr_accessible :source, :rating, :tag_string, :old_tag_string, :last_noted_at, :parent_id, :as => [:member, :builder, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
||||||
attr_accessible :is_rating_locked, :is_note_locked, :as => [:janitor, :moderator, :admin]
|
attr_accessible :is_rating_locked, :is_note_locked, :as => [:builder, :janitor, :moderator, :admin]
|
||||||
attr_accessible :is_status_locked, :as => [:admin]
|
attr_accessible :is_status_locked, :as => [:admin]
|
||||||
|
|
||||||
module FileMethods
|
module FileMethods
|
||||||
|
|||||||
@@ -254,11 +254,23 @@ class User < ActiveRecord::Base
|
|||||||
|
|
||||||
def role
|
def role
|
||||||
case level
|
case level
|
||||||
when Levels::MEMBER, Levels::PRIVILEGED, Levels::BUILDER, Levels::CONTRIBUTOR
|
when Levels::MEMBER
|
||||||
:member
|
:member
|
||||||
|
|
||||||
when Levels::MODERATOR, Levels::JANITOR
|
when Levels::PRIVILEGED
|
||||||
|
:privileged
|
||||||
|
|
||||||
|
when Levels::BUILDER
|
||||||
|
:builder
|
||||||
|
|
||||||
|
when Levels::CONTRIBUTOR
|
||||||
|
:contributor
|
||||||
|
|
||||||
|
when Levels::MODERATOR
|
||||||
:moderator
|
:moderator
|
||||||
|
|
||||||
|
when Levels::JANITOR
|
||||||
|
:janitor
|
||||||
|
|
||||||
when Levels::ADMIN
|
when Levels::ADMIN
|
||||||
:admin
|
:admin
|
||||||
|
|||||||
Reference in New Issue
Block a user