Browse Source

Change Like

pull/278/head
sylor_huang@126.com 5 years ago
parent
commit
f632424f13
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/models/user.rb

+ 1
- 1
app/models/user.rb View File

@@ -96,7 +96,7 @@ class User < ApplicationRecord
# Groups and active users
scope :active, lambda { where(status: STATUS_ACTIVE) }
scope :like, lambda { |keywords|
where("LOWER(concat(lastname, firstname, login, mail)) LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank?
where("LOWER(concat(nickname, lastname, firstname, login, mail)) LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank?
}

scope :simple_select, -> {select(:id, :login, :lastname,:firstname, :nickname, :gitea_uid)}


Loading…
Cancel
Save