Skip to content

Commit

Permalink
Order specialties regardless of case
Browse files Browse the repository at this point in the history
  • Loading branch information
joemasilotti committed Apr 11, 2024
1 parent 0170ec1 commit 0c5cf69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/specialties_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Admin
class SpecialtiesController < ApplicationController
def index
@specialties = Specialty.includes(developers: :user).order(:name)
@specialties = Specialty.includes(developers: :user).visible
end

def new
Expand Down
2 changes: 1 addition & 1 deletion app/models/specialty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Specialty < ApplicationRecord
validates :name, presence: true
validates :name, uniqueness: true

scope :visible, -> { order(:name) }
scope :visible, -> { order("LOWER(name)") }

before_validation :normalize_name

Expand Down

0 comments on commit 0c5cf69

Please sign in to comment.