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
39918c3b
Commit
39918c3b
authored
Aug 29, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix License.feature_available? when license table does not exist
parent
e1f31849
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/models/license.rb
app/models/license.rb
+2
-0
spec/models/license_spec.rb
spec/models/license_spec.rb
+11
-0
No files found.
app/models/license.rb
View file @
39918c3b
...
...
@@ -204,6 +204,8 @@ class License < ActiveRecord::Base
end
def
load_license
return
unless
ActiveRecord
::
Base
.
connection
.
table_exists?
(
:licenses
)
license
=
self
.
last
return
unless
license
&&
license
.
valid?
...
...
spec/models/license_spec.rb
View file @
39918c3b
...
...
@@ -271,6 +271,17 @@ describe License do
end
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
)
end
it
'returns nil'
do
expect
(
described_class
.
current
).
to
be_nil
end
end
context
"when there is no license"
do
let!
(
:license
)
{
nil
}
...
...
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