Merge branch 'master' of github.com:r888888888/danbooru
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class ArtistVersion < ActiveRecord::Base
|
||||
belongs_to :updater
|
||||
belongs_to :updater, :class_name => "User"
|
||||
belongs_to :artist
|
||||
|
||||
def self.search(params)
|
||||
|
||||
@@ -3,6 +3,7 @@ class Comment < ActiveRecord::Base
|
||||
validates_format_of :body, :with => /\S/, :message => 'has no content'
|
||||
belongs_to :post
|
||||
belongs_to :creator, :class_name => "User"
|
||||
belongs_to :updater, :class_name => "User"
|
||||
has_many :votes, :class_name => "CommentVote", :dependent => :destroy
|
||||
before_validation :initialize_creator, :on => :create
|
||||
before_validation :initialize_updater
|
||||
|
||||
@@ -2,6 +2,7 @@ class ForumPost < ActiveRecord::Base
|
||||
attr_accessible :body, :topic_id, :as => [:member, :builder, :janitor, :privileged, :platinum, :contributor, :admin, :moderator, :default]
|
||||
attr_accessible :is_locked, :is_sticky, :is_deleted, :as => [:admin, :moderator, :janitor]
|
||||
belongs_to :creator, :class_name => "User"
|
||||
belongs_to :updater, :class_name => "User"
|
||||
belongs_to :topic, :class_name => "ForumTopic"
|
||||
before_validation :initialize_creator, :on => :create
|
||||
before_validation :initialize_updater
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Tag < ActiveRecord::Base
|
||||
METATAGS = "-user|user|-approver|approver|-pool|pool|-fav|fav|sub|md5|-rating|rating|width|height|mpixels|score|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv"
|
||||
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|width|height|mpixels|score|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv"
|
||||
attr_accessible :category
|
||||
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
|
||||
|
||||
@@ -280,6 +280,14 @@ class Tag < ActiveRecord::Base
|
||||
q[:approver_id] = User.name_to_id($2)
|
||||
q[:approver_id] = -1 if q[:approver_id].nil?
|
||||
|
||||
when "commenter", "comm"
|
||||
q[:commenter_id] = User.name_to_id($2)
|
||||
q[:commenter_id] = -1 if q[:commenter_id].nil?
|
||||
|
||||
when "noter"
|
||||
q[:noter_id] = User.name_to_id($2)
|
||||
q[:noter_id] = -1 if q[:noter_id].nil?
|
||||
|
||||
when "-pool"
|
||||
q[:tags][:exclude] << "pool:#{Pool.name_to_id($2)}"
|
||||
|
||||
|
||||
@@ -355,6 +355,10 @@ class User < ActiveRecord::Base
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
def level_class
|
||||
"user-#{level_string.downcase}"
|
||||
end
|
||||
end
|
||||
|
||||
module EmailMethods
|
||||
|
||||
Reference in New Issue
Block a user