Change param asc to ascending
For consistency, change param asc to ascending: https://meta.discourse.org/t/make-admin-users-list-sortable-suggestion/47649/17?u=oblakeerickson
This commit is contained in:
parent
0a41da6bad
commit
e9d5c3265c
|
@ -27,7 +27,7 @@ class AdminUserIndexQuery
|
|||
end
|
||||
|
||||
def custom_direction
|
||||
asc = params[:asc]
|
||||
asc = params[:ascending]
|
||||
asc.present? && asc ? "ASC" : "DESC"
|
||||
end
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ describe AdminUserIndexQuery do
|
|||
end
|
||||
|
||||
it "allows custom ordering asc" do
|
||||
query = ::AdminUserIndexQuery.new({ order: "trust_level", asc: true })
|
||||
query = ::AdminUserIndexQuery.new({ order: "trust_level", ascending: true })
|
||||
expect(query.find_users_query.to_sql).to match("trust_level ASC" )
|
||||
end
|
||||
|
||||
|
@ -38,7 +38,7 @@ describe AdminUserIndexQuery do
|
|||
end
|
||||
|
||||
it "allows custom ordering and direction for stats" do
|
||||
query = ::AdminUserIndexQuery.new({ order: "topics_entered", asc: true })
|
||||
query = ::AdminUserIndexQuery.new({ order: "topics_entered", ascending: true })
|
||||
expect(query.find_users_query.to_sql).to match("topics_entered ASC")
|
||||
end
|
||||
end
|
||||
|
@ -91,7 +91,7 @@ describe AdminUserIndexQuery do
|
|||
end
|
||||
|
||||
it "shows nil values first with asc" do
|
||||
users = ::AdminUserIndexQuery.new({ order: "last_emailed_at", asc: true }).find_users
|
||||
users = ::AdminUserIndexQuery.new({ order: "last_emailed_at", ascending: true }).find_users
|
||||
|
||||
expect(users.count).to eq(2)
|
||||
expect(users.first.username).to eq("system")
|
||||
|
|
Loading…
Reference in New Issue