diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-07-07 13:16:53 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-07-07 13:16:53 +0000 |
commit | 87d90b5b5e2fa6d0eed469db61878b942afdbee7 (patch) | |
tree | 6714fab62ed6d90d13fad79f9132ea6ab180d0e9 /app | |
parent | c0e18e865778a4886eb9aada33c7e6bdd80ee099 (diff) | |
parent | 38fd773bd3bb7ff479ca3d607da6966139e262e3 (diff) | |
download | gitlab-ce-87d90b5b5e2fa6d0eed469db61878b942afdbee7.tar.gz |
Merge branch 'fix-sha-attribute-no-table' into 'master'
Fix ShaAttribute concern when there is no table
Closes #34798
See merge request !12705
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/sha_attribute.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/concerns/sha_attribute.rb b/app/models/concerns/sha_attribute.rb index c28974a3cdf..67ecf470f7e 100644 --- a/app/models/concerns/sha_attribute.rb +++ b/app/models/concerns/sha_attribute.rb @@ -3,6 +3,8 @@ module ShaAttribute module ClassMethods def sha_attribute(name) + return unless table_exists? + column = columns.find { |c| c.name == name.to_s } # In case the table doesn't exist we won't be able to find the column, |