fix vulnerabilities
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user