mirror of
https://github.com/discourse/discourse.git
synced 2025-04-15 15:30:52 +08:00
uniqueness constraint is not correct scoping on hidden is not fully correct
simpler just to handle it in the DB
This commit is contained in:
parent
57ef9bb21b
commit
73041c0e14
@ -3,7 +3,6 @@ class ApiKey < ActiveRecord::Base
|
|||||||
belongs_to :created_by, class_name: User
|
belongs_to :created_by, class_name: User
|
||||||
|
|
||||||
validates_presence_of :key
|
validates_presence_of :key
|
||||||
validates_uniqueness_of :user_id
|
|
||||||
|
|
||||||
def regenerate!(updated_by)
|
def regenerate!(updated_by)
|
||||||
self.key = SecureRandom.hex(32)
|
self.key = SecureRandom.hex(32)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user