Skip to content

Commit

Permalink
Merge pull request #11034 from krauselukas/token_model_uniqueness_val…
Browse files Browse the repository at this point in the history
…idation

Add uniqueness validation for token string
  • Loading branch information
vpereira committed Apr 26, 2021
2 parents f188ed3 + 9bed780 commit f6bc366
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/app/models/token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Token < ApplicationRecord
has_secure_token :string

validates :user, presence: true
validates :string, uniqueness: { case_sensitive: false }

include Token::Errors

Expand Down

0 comments on commit f6bc366

Please sign in to comment.