fix vulnerabilities
CI / scan_ruby (push) Successful in 23s
CI / scan_js (push) Failing after 10s
CI / lint (push) Failing after 19s
CI / test (push) Failing after 16s
CI / system-test (push) Failing after 15s

This commit is contained in:
2026-01-26 21:38:17 +01:00
parent 35f10c4bda
commit a69be52b72
6 changed files with 54 additions and 17 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class Entry < ApplicationRecord
return none unless valid_lang?(language_code)
where.not(language_code => [ nil, "" ])
.order(Arel.sql("#{language_code} ASC"))
.order(arel_table[language_code].asc)
end
private
+3
View File
@@ -21,6 +21,9 @@ class User < ApplicationRecord
validates :email, presence: true, uniqueness: true
validates :password, length: { minimum: 12 }, if: -> { password.present? }
scope :by_role, ->(role) { where(role: role) if role.present? }
scope :search_email, ->(q) { where("email LIKE ?", "%#{sanitize_sql_like(q)}%") if q.present? }
# Invitation token expires after 14 days
INVITATION_TOKEN_EXPIRY = 14.days