Commit ac5842d9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Migrate application to rails 4 step 1

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 8a54fda4
require File.expand_path('../boot', __FILE__) require File.expand_path('../boot', __FILE__)
require 'rails/all' require 'rails/all'
require 'devise'
if defined?(Bundler) Bundler.require(:default, Rails.env)
# If you precompile assets before deploying to production, use this line
# Bundler.require(*Rails.groups(assets: %w(development test)))
# If you want your assets lazily compiled in production, use this line
Bundler.require(:default, :assets, Rails.env)
end
module Gitlab module Gitlab
class Application < Rails::Application class Application < Rails::Application
......
...@@ -6,6 +6,7 @@ Devise.setup do |config| ...@@ -6,6 +6,7 @@ Devise.setup do |config|
# note that it will be overwritten if you use your own mailer class with default "from" parameter. # note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = Gitlab.config.gitlab.email_from config.mailer_sender = Gitlab.config.gitlab.email_from
# Configure the class responsible to send e-mails. # Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer" # config.mailer = "Devise::Mailer"
......
# Workaround for https://github.com/github/gemoji/pull/18 # Workaround for https://github.com/github/gemoji/pull/18
require 'gemoji'
Gitlab::Application.config.assets.paths << Emoji.images_path Gitlab::Application.config.assets.paths << Emoji.images_path
...@@ -21,3 +21,4 @@ def find_secure_token ...@@ -21,3 +21,4 @@ def find_secure_token
end end
Gitlab::Application.config.secret_token = find_secure_token Gitlab::Application.config.secret_token = find_secure_token
Gitlab::Application.config.secret_key_base = find_secure_token
...@@ -22,7 +22,7 @@ Gitlab::Application.routes.draw do ...@@ -22,7 +22,7 @@ Gitlab::Application.routes.draw do
project_root: Gitlab.config.gitlab_shell.repos_path, project_root: Gitlab.config.gitlab_shell.repos_path,
upload_pack: Gitlab.config.gitlab_shell.upload_pack, upload_pack: Gitlab.config.gitlab_shell.upload_pack,
receive_pack: Gitlab.config.gitlab_shell.receive_pack receive_pack: Gitlab.config.gitlab_shell.receive_pack
}), at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) } }), at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post]
# #
# Help # Help
...@@ -131,7 +131,7 @@ Gitlab::Application.routes.draw do ...@@ -131,7 +131,7 @@ Gitlab::Application.routes.draw do
end end
end end
match "/u/:username" => "users#show", as: :user, constraints: { username: /.*/ } match "/u/:username" => "users#show", as: :user, constraints: { username: /.*/ }, via: :get
......
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