fixes to user search
This commit is contained in:
@@ -258,6 +258,12 @@ class Artist < ActiveRecord::Base
|
||||
when /./
|
||||
q = q.any_name_matches(params[:name])
|
||||
end
|
||||
|
||||
if params[:sort] == "Name"
|
||||
q = q.reorder("name")
|
||||
else
|
||||
q = q.reorder("id desc")
|
||||
end
|
||||
|
||||
if params[:id].present?
|
||||
q = q.where("id = ?", params[:id])
|
||||
|
||||
@@ -14,6 +14,12 @@ class ArtistVersion < ActiveRecord::Base
|
||||
q = q.where("artist_id = ?", params[:artist_id].to_i)
|
||||
end
|
||||
|
||||
if params[:sort] == "Name"
|
||||
q = q.reorder("name")
|
||||
else
|
||||
q = q.reorder("id desc")
|
||||
end
|
||||
|
||||
q
|
||||
end
|
||||
|
||||
|
||||
@@ -220,7 +220,8 @@ class User < ActiveRecord::Base
|
||||
def level_hash
|
||||
return {
|
||||
"Member" => Levels::MEMBER,
|
||||
"Privileged" => Levels::PRIVILEGED,
|
||||
"Gold" => Levels::PRIVILEGED,
|
||||
"Platinum" => Levels::PLATINUM,
|
||||
"Builder" => Levels::BUILDER,
|
||||
"Contributor" => Levels::CONTRIBUTOR,
|
||||
"Janitor" => Levels::JANITOR,
|
||||
@@ -427,13 +428,13 @@ class User < ActiveRecord::Base
|
||||
def favorite_limit
|
||||
return nil
|
||||
|
||||
if is_privileged?
|
||||
20_000
|
||||
elsif is_platinum?
|
||||
nil
|
||||
else
|
||||
4_000
|
||||
end
|
||||
# if is_privileged?
|
||||
# 20_000
|
||||
# elsif is_platinum?
|
||||
# nil
|
||||
# else
|
||||
# 4_000
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user