Simplify License#load_license method

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