work on refactoring search

This commit is contained in:
albert
2013-01-08 15:53:21 -05:00
parent 80f34d08d9
commit 13271e9bf5
19 changed files with 152 additions and 45 deletions

View File

@@ -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