Commit 8faec45b authored by Thong Kuah's avatar Thong Kuah

Fix ShaAttribute to not have implicit dependency on DatabaseReflection

Includes DatabaseReflection for models which may not descend from
ApplicationRecord
parent 17b440bb
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
module ShaAttribute module ShaAttribute
extend ActiveSupport::Concern extend ActiveSupport::Concern
# Needed for the database method
include DatabaseReflection
class_methods do class_methods do
def sha_attribute(name) def sha_attribute(name)
return if ENV['STATIC_VERIFICATION'] return if ENV['STATIC_VERIFICATION']
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ShaAttribute do RSpec.describe ShaAttribute do
let(:model) { Class.new(ApplicationRecord) { include ShaAttribute } } let(:model) { Class.new(ActiveRecord::Base) { include ShaAttribute } }
before do before do
columns = [ 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