This commit is contained in:
r888888888
2013-06-20 15:10:34 -07:00
parent 99cb177398
commit 774dadf7a5
5 changed files with 43 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
class Tag < ActiveRecord::Base
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|pixiv_id|pixiv"
attr_accessible :category
attr_accessible :category, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin]
attr_accessible :is_locked, :as => [:moderator, :janitor, :admin]
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
module ApiMethods
@@ -141,7 +142,7 @@ class Tag < ActiveRecord::Base
if category
category_id = categories.value_for(category)
if category_id != tag.category && (CurrentUser.is_builder? || tag.post_count <= 50)
if category_id != tag.category && !tag.is_locked? && (CurrentUser.is_builder? || tag.post_count <= 50)
tag.update_column(:category, category_id)
tag.update_category_cache_for_all
end