Merge pull request #3495 from BrokenEagle/fix-missing-super-search

Fix missing controllers for search[id] (Ref #3430)
This commit is contained in:
Albert Yi
2018-01-15 11:11:24 -08:00
committed by GitHub
4 changed files with 8 additions and 7 deletions

View File

@@ -6,8 +6,8 @@ class ArtistCommentaryVersion < ApplicationRecord
attr_accessible :post_id, :original_title, :original_description, :translated_title, :translated_description
def self.search(params)
q = where("true")
params = {} if params.blank?
q = super
return q if params.blank?
if params[:updater_id]
q = q.where("updater_id = ?", params[:updater_id].to_i)

View File

@@ -26,7 +26,8 @@ class Ban < ApplicationRecord
end
def self.search(params)
q = where("true")
q = super
return q if params.blank?
if params[:banner_name]
q = q.where("banner_id = (select _.id from users _ where lower(_.name) = ?)", params[:banner_name].mb_chars.downcase)

View File

@@ -51,8 +51,8 @@ class ModAction < ApplicationRecord
other: 2000
}
def self.search(params = {})
q = where("true")
def self.search(params)
q = super
return q if params.blank?
if params[:creator_id].present?

View File

@@ -5,8 +5,8 @@ class NoteVersion < ApplicationRecord
attr_accessible :note_id, :x, :y, :width, :height, :body, :updater_id, :updater_ip_addr, :is_active, :post_id, :html_id, :version
def self.search(params)
q = where("true")
params = {} if params.blank?
q = super
return q if params.blank?
if params[:updater_id]
q = q.where(updater_id: params[:updater_id].split(",").map(&:to_i))