Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
af040ec7
Commit
af040ec7
authored
Aug 29, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify License#load_license method
parent
b7c943aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
app/models/license.rb
app/models/license.rb
+1
-1
spec/models/license_spec.rb
spec/models/license_spec.rb
+1
-2
No files found.
app/models/license.rb
View file @
af040ec7
...
...
@@ -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
...
...
spec/models/license_spec.rb
View file @
af040ec7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment