diff options
author | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-04-19 10:36:16 +0200 |
---|---|---|
committer | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-05-06 16:42:44 +0100 |
commit | 6accad69e214f44ac84f3ceac4159c712aa9af2e (patch) | |
tree | 5b07c67d5be2667a1187c13efb37424a6356af41 /app/models/project.rb | |
parent | b736a9f000d1e1f6c2c94ea74a700abf5a44139e (diff) | |
download | gitlab-ce-6accad69e214f44ac84f3ceac4159c712aa9af2e.tar.gz |
Added blank lines to meet style guide
Un-nest title variable output
Update spec test names
Rename sort_value_most_stars -> sort_value_stars_desc
Rename sorted_by_stars -> sorted_by_stars_desc
Renname sort_value_most_stars_asc -> sort_value_stars_asc
Invert feature check, assign feature condition to a variable
Inline conditional nav bar rendering
Invert conditional label
Added follow up task
Fix filters returning 0 projects show the wrong view
Move click action out of test expectation
Use proper variable name for project in before block
Rename projects_sort_admin_options_hash
Renamed projects_sort_admin_options_has to
old_projects_sort_options_hash as its not only used
on the admin screen
Fix extra whitespace errors
Stub project_list_filter_bar in the projects_helper specs
Added follow up task for `show_projects?`
Removed url test expectations
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index da5f2c2e96e..da72186c8a0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -357,7 +357,7 @@ class Project < ApplicationRecord # last_activity_at is throttled every minute, but last_repository_updated_at is updated with every push scope :sorted_by_activity, -> { reorder("GREATEST(COALESCE(last_activity_at, '1970-01-01'), COALESCE(last_repository_updated_at, '1970-01-01')) DESC") } - scope :sorted_by_stars, -> { reorder(star_count: :desc) } + scope :sorted_by_stars_desc, -> { reorder(star_count: :desc) } scope :sorted_by_stars_asc, -> { reorder(star_count: :asc) } scope :in_namespace, ->(namespace_ids) { where(namespace_id: namespace_ids) } @@ -545,7 +545,7 @@ class Project < ApplicationRecord when 'latest_activity_asc' reorder(last_activity_at: :asc) when 'stars_desc' - sorted_by_stars + sorted_by_stars_desc when 'stars_asc' sorted_by_stars_asc else |