Simplify License#load_license method

parent b7c943aa
......@@ -204,7 +204,7 @@ class License < ActiveRecord::Base
end
def load_license
return unless ActiveRecord::Base.connection.table_exists?(:licenses)
return unless self.table_exists?
license = self.last
......
......@@ -273,8 +273,7 @@ describe License do
describe ".current" do
context 'when licenses table does not exist' do
before do
allow(ActiveRecord::Base.connection).to receive(:table_exists?)
.with(:licenses).and_return(false)
allow(described_class).to receive(:table_exists?).and_return(false)
end
it 'returns nil' do
......
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