Commit ac5842d970ba305681bb1c0826db769243101123

Authored by Dmitriy Zaporozhets
1 parent 8a54fda4

Migrate application to rails 4 step 1

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