Skip to content
Snippets Groups Projects
Commit 2d162ff9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix for mysql database cause key is a reserved word

parent 770f18ac
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -24,7 +24,7 @@ class Key < ActiveRecord::Base
end
 
def unique_key
query = Key.where('key = ?', key)
query = Key.where('`key` = ?', key)
query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id
if (query.count > 0)
errors.add :key, 'already exist.'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment