app/controllers/hyrax/users_controller.rb in hyrax-2.1.0.beta1 vs app/controllers/hyrax/users_controller.rb in hyrax-2.1.0.beta2
- old
+ new
@@ -22,12 +22,10 @@
# Returns a list of users excluding the system users and guest_users
# @param query [String] the query string
def search(query)
clause = query.blank? ? nil : "%" + query.downcase + "%"
base = ::User.where(*base_query)
- if clause.present?
- base = base.where("#{Hydra.config.user_key_field} like lower(?) OR display_name like lower(?)", clause, clause)
- end
+ base = base.where("#{Hydra.config.user_key_field} like lower(?) OR display_name like lower(?)", clause, clause) if clause.present?
base.registered
.where("#{Hydra.config.user_key_field} not in (?)",
[::User.batch_user_key, ::User.audit_user_key])
.references(:trophies)
.order(sort_value)