Commit b16fb53f authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'sha_attribute_binary_validation_in_test' into 'master'

Fix undefined method `database` in ShaAttribute

See merge request gitlab-org/gitlab!74751
parents db4f38e1 8faec45b
......@@ -3,11 +3,14 @@
module ShaAttribute
extend ActiveSupport::Concern
# Needed for the database method
include DatabaseReflection
class_methods do
def sha_attribute(name)
return if ENV['STATIC_VERIFICATION']
validate_binary_column_exists!(name) if Rails.env.development?
validate_binary_column_exists!(name) if Rails.env.development? || Rails.env.test?
attribute(name, Gitlab::Database::ShaAttribute.new)
end
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe ShaAttribute do
let(:model) { Class.new(ApplicationRecord) { include ShaAttribute } }
let(:model) { Class.new(ActiveRecord::Base) { include ShaAttribute } }
before do
columns = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment