Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8512d40de22e
Commit
8512d40d
authored
Sep 05, 2016
by
Connor Shea
Browse files
Fix two problematic bits of code that will be deprecated or broken in Rails 5.
parent
4d149a6d9b93
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
8512d40d
...
...
@@ -58,7 +58,7 @@
# Relations
belongs_to
:creator
,
foreign_key:
'creator_id'
,
class_name:
'User'
belongs_to
:group
,
->
{
where
(
type:
Group
)
},
foreign_key:
'namespace_id'
belongs_to
:group
,
->
{
where
(
type:
'
Group
'
)
},
foreign_key:
'namespace_id'
belongs_to
:namespace
has_one
:last_event
,
->
{
order
'events.created_at DESC'
},
class_name:
'Event'
,
foreign_key:
'project_id'
...
...
config/initializers/mime_types.rb
View file @
8512d40d
...
...
@@ -13,9 +13,11 @@
Mime
::
Type
.
register
"video/webm"
,
:webm
Mime
::
Type
.
register
"video/ogg"
,
:ogv
middlewares
=
Gitlab
::
Application
.
config
.
middleware
middlewares
.
swap
(
ActionDispatch
::
ParamsParser
,
ActionDispatch
::
ParamsParser
,
{
Mime
::
Type
.
lookup
(
'application/vnd.git-lfs+json'
)
=>
lambda
do
|
body
|
ActiveSupport
::
JSON
.
decode
(
body
)
end
})
lfs_mime_types
=
%w(
application/vnd.git-lfs+json
text/x-json
application/json
)
Mime
::
Type
.
unregister
:json
Mime
::
Type
.
register
'application/json'
,
:json
,
lfs_mime_types
Write
Preview
Supports
Markdown
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