Commit f0deea60 authored by Stan Hu's avatar Stan Hu

Merge branch '3280-fix-feature-available-check-when-license-table-does-not-exist' into 'master'

Check if `licenses` table exists before loading the current license.

Closes #3280

See merge request !2783
parents 981835bf af040ec7
......@@ -204,6 +204,8 @@ class License < ActiveRecord::Base
end
def load_license
return unless self.table_exists?
license = self.last
return unless license && license.valid?
......
---
title: Check if table exists before loading the current license.
merge_request: 2783
author:
type: fixed
......@@ -271,6 +271,16 @@ describe License do
end
describe ".current" do
context 'when licenses table does not exist' do
before do
allow(described_class).to receive(:table_exists?).and_return(false)
end
it 'returns nil' do
expect(described_class.current).to be_nil
end
end
context "when there is no license" do
let!(:license) { nil }
......
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