Commit 2d162ff9ac129f9c327db3cbd982d9a2c06f4a68
1 parent
770f18ac
Exists in
master
and in
4 other branches
Fix for mysql database cause key is a reserved word
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/key.rb
... | ... | @@ -24,7 +24,7 @@ class Key < ActiveRecord::Base |
24 | 24 | end |
25 | 25 | |
26 | 26 | def unique_key |
27 | - query = Key.where('key = ?', key) | |
27 | + query = Key.where('`key` = ?', key) | |
28 | 28 | query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id |
29 | 29 | if (query.count > 0) |
30 | 30 | errors.add :key, 'already exist.' | ... | ... |