models: set more creator names explicitly.
Set creators explicitly for bans, BURs, comment votes, and posts.
This commit is contained in:
@@ -19,7 +19,6 @@ class ForumTopic < ApplicationRecord
|
||||
has_many :moderation_reports, through: :posts
|
||||
has_one :original_post, -> {order("forum_posts.id asc")}, class_name: "ForumPost", foreign_key: "topic_id", inverse_of: :topic
|
||||
|
||||
before_validation :initialize_is_deleted, :on => :create
|
||||
validates_presence_of :title
|
||||
validates_associated :original_post
|
||||
validates_inclusion_of :category_id, :in => CATEGORIES.keys
|
||||
@@ -151,10 +150,6 @@ class ForumTopic < ApplicationRecord
|
||||
ModAction.log("undeleted forum topic ##{id} (title: #{title})", :forum_topic_undelete)
|
||||
end
|
||||
|
||||
def initialize_is_deleted
|
||||
self.is_deleted = false if is_deleted.nil?
|
||||
end
|
||||
|
||||
def page_for(post_id)
|
||||
(posts.where("id < ?", post_id).count / Danbooru.config.posts_per_page.to_f).ceil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user