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
|
||||
|
||||
validates_presence_of :key
|
||||
validates_uniqueness_of :user_id
|
||||
|
||||
def regenerate!(updated_by)
|
||||
self.key = SecureRandom.hex(32)
|
||||
|
|
Loading…
Reference in New Issue