Commit 527d223680864a40887674768cf83a4a8626ead9
1 parent
51f48392
Exists in
master
and in
4 other branches
Update Rails config
Showing
4 changed files
with
31 additions
and
22 deletions
Show diff stats
config/application.rb
... | ... | @@ -4,7 +4,7 @@ require 'rails/all' |
4 | 4 | |
5 | 5 | if defined?(Bundler) |
6 | 6 | # If you precompile assets before deploying to production, use this line |
7 | - # Bundler.require *Rails.groups(:assets => %w(development test)) | |
7 | + # Bundler.require(*Rails.groups(:assets => %w(development test))) | |
8 | 8 | # If you want your assets lazily compiled in production, use this line |
9 | 9 | Bundler.require(:default, :assets, Rails.env) |
10 | 10 | end |
... | ... | @@ -47,6 +47,14 @@ module Gitlab |
47 | 47 | # Configure sensitive parameters which will be filtered from the log file. |
48 | 48 | config.filter_parameters += [:password] |
49 | 49 | |
50 | + # Enable escaping HTML in JSON. | |
51 | + config.active_support.escape_html_entities_in_json = true | |
52 | + | |
53 | + # Use SQL instead of Active Record's schema dumper when creating the database. | |
54 | + # This is necessary if your schema can't be completely dumped by the schema dumper, | |
55 | + # like if you have constraints or database-specific column types | |
56 | + # config.active_record.schema_format = :sql | |
57 | + | |
50 | 58 | # Enforce whitelist mode for mass assignment. |
51 | 59 | # This will create an empty whitelist of attributes available for mass-assignment for all models |
52 | 60 | # in your app. As such, your models will need to explicitly whitelist or blacklist accessible | ... | ... |
config/environments/development.rb
... | ... | @@ -2,7 +2,7 @@ Gitlab::Application.configure do |
2 | 2 | # Settings specified here will take precedence over those in config/application.rb |
3 | 3 | |
4 | 4 | # In the development environment your application's code is reloaded on |
5 | - # every request. This slows down response time but is perfect for development | |
5 | + # every request. This slows down response time but is perfect for development | |
6 | 6 | # since you don't have to restart the web server when you make code changes. |
7 | 7 | config.cache_classes = false |
8 | 8 | |
... | ... | @@ -22,19 +22,21 @@ Gitlab::Application.configure do |
22 | 22 | # Only use best-standards-support built into browsers |
23 | 23 | config.action_dispatch.best_standards_support = :builtin |
24 | 24 | |
25 | + # Raise exception on mass assignment protection for Active Record models | |
26 | + config.active_record.mass_assignment_sanitizer = :strict | |
27 | + | |
28 | + # Log the query plan for queries taking more than this (works | |
29 | + # with SQLite, MySQL, and PostgreSQL) | |
30 | + config.active_record.auto_explain_threshold_in_seconds = 0.5 | |
31 | + | |
25 | 32 | # Do not compress assets |
26 | 33 | config.assets.compress = false |
27 | 34 | |
28 | 35 | # Expands the lines which load the assets |
29 | 36 | config.assets.debug = true |
30 | 37 | |
31 | - config.action_mailer.default_url_options = { :host => 'localhost:3000' } | |
38 | + # For having correct urls in mails | |
39 | + config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } | |
40 | + # Open sent mails in browser | |
32 | 41 | config.action_mailer.delivery_method = :letter_opener |
33 | - | |
34 | - # Raise exception on mass assignment protection for Active Record models | |
35 | - config.active_record.mass_assignment_sanitizer = :strict | |
36 | - | |
37 | - # Log the query plan for queries taking more than this (works | |
38 | - # with SQLite, MySQL, and PostgreSQL) | |
39 | - config.active_record.auto_explain_threshold_in_seconds = 0.5 | |
40 | 42 | end | ... | ... |
config/environments/production.rb
... | ... | @@ -20,7 +20,7 @@ Gitlab::Application.configure do |
20 | 20 | # Generate digests for assets URLs |
21 | 21 | config.assets.digest = true |
22 | 22 | |
23 | - # Defaults to Rails.root.join("public/assets") | |
23 | + # Defaults to nil and saved in location specified by config.assets.prefix | |
24 | 24 | # config.assets.manifest = YOUR_PATH |
25 | 25 | |
26 | 26 | # Specifies the header that your server uses for sending files |
... | ... | @@ -33,8 +33,11 @@ Gitlab::Application.configure do |
33 | 33 | # See everything in the log (default is :info) |
34 | 34 | # config.log_level = :debug |
35 | 35 | |
36 | + # Prepend all log lines with the following tags | |
37 | + # config.log_tags = [ :subdomain, :uuid ] | |
38 | + | |
36 | 39 | # Use a different logger for distributed setups |
37 | - # config.logger = SyslogLogger.new | |
40 | + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) | |
38 | 41 | |
39 | 42 | # Use a different cache store in production |
40 | 43 | config.cache_store = :memory_store |
... | ... | @@ -58,6 +61,10 @@ Gitlab::Application.configure do |
58 | 61 | # Send deprecation notices to registered listeners |
59 | 62 | config.active_support.deprecation = :notify |
60 | 63 | |
64 | + # Log the query plan for queries taking more than this (works | |
65 | + # with SQLite, MySQL, and PostgreSQL) | |
66 | + # config.active_record.auto_explain_threshold_in_seconds = 0.5 | |
67 | + | |
61 | 68 | config.action_mailer.delivery_method = :sendmail |
62 | 69 | # Defaults to: |
63 | 70 | # # config.action_mailer.sendmail_settings = { | ... | ... |
config/environments/test.rb
... | ... | @@ -2,9 +2,9 @@ Gitlab::Application.configure do |
2 | 2 | # Settings specified here will take precedence over those in config/application.rb |
3 | 3 | |
4 | 4 | # The test environment is used exclusively to run your application's |
5 | - # test suite. You never need to work with it otherwise. Remember that | |
5 | + # test suite. You never need to work with it otherwise. Remember that | |
6 | 6 | # your test database is "scratch space" for the test suite and is wiped |
7 | - # and recreated between test runs. Don't rely on the data there! | |
7 | + # and recreated between test runs. Don't rely on the data there! | |
8 | 8 | config.cache_classes = true |
9 | 9 | |
10 | 10 | # Configure static asset server for tests with Cache-Control for performance |
... | ... | @@ -29,17 +29,9 @@ Gitlab::Application.configure do |
29 | 29 | # ActionMailer::Base.deliveries array. |
30 | 30 | config.action_mailer.delivery_method = :test |
31 | 31 | |
32 | - # Use SQL instead of Active Record's schema dumper when creating the test database. | |
33 | - # This is necessary if your schema can't be completely dumped by the schema dumper, | |
34 | - # like if you have constraints or database-specific column types | |
35 | - # config.active_record.schema_format = :sql | |
36 | - | |
37 | 32 | # Raise exception on mass assignment protection for Active Record models |
38 | 33 | # config.active_record.mass_assignment_sanitizer = :strict |
39 | 34 | |
40 | 35 | # Print deprecation notices to the stderr |
41 | 36 | config.active_support.deprecation = :stderr |
42 | - | |
43 | - # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets | |
44 | - config.assets.allow_debugging = true | |
45 | 37 | end | ... | ... |