work on refactoring search
This commit is contained in:
@@ -2,6 +2,16 @@ class ArtistVersion < ActiveRecord::Base
|
||||
belongs_to :updater
|
||||
belongs_to :artist
|
||||
|
||||
def self.search(params)
|
||||
q = scoped
|
||||
|
||||
if params[:artist_id]
|
||||
q = q.where("artist_id = ?", params[:artist_id].to_i)
|
||||
end
|
||||
|
||||
q
|
||||
end
|
||||
|
||||
def updater_name
|
||||
User.id_to_name(updater_id).tr("_", " ")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user