8784: Fix test for latest firefox.
[arvados.git] / services / api / config / application.rb
1 require File.expand_path('../boot', __FILE__)
2
3 require 'rails/all'
4 require 'digest'
5
6 module Kernel
7   def suppress_warnings
8     verbose_orig = $VERBOSE
9     begin
10       $VERBOSE = nil
11       yield
12     ensure
13       $VERBOSE = verbose_orig
14     end
15   end
16 end
17
18 if defined?(Bundler)
19   suppress_warnings do
20     # If you precompile assets before deploying to production, use this line
21     Bundler.require(*Rails.groups(:assets => %w(development test)))
22     # If you want your assets lazily compiled in production, use this line
23     # Bundler.require(:default, :assets, Rails.env)
24   end
25 end
26
27 module Server
28   class Application < Rails::Application
29     # Settings in config/environments/* take precedence over those specified here.
30     # Application configuration should go into files in config/initializers
31     # -- all .rb files in that directory are automatically loaded.
32
33     # Custom directories with classes and modules you want to be autoloadable.
34     # config.autoload_paths += %W(#{config.root}/extras)
35
36     # Only load the plugins named here, in the order given (default is alphabetical).
37     # :all can be used as a placeholder for all plugins not explicitly named.
38     # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
39
40     # Activate observers that should always be running.
41     # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
42     config.active_record.schema_format = :sql
43
44     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
45     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
46     # config.i18n.default_locale = :de
47
48     # Configure sensitive parameters which will be filtered from the log file.
49     config.filter_parameters += [:password]
50
51     # Load entire application at startup.
52     config.eager_load = true
53
54     config.active_record.raise_in_transactional_callbacks = true
55
56     config.active_support.test_order = :sorted
57
58     config.action_dispatch.perform_deep_munge = false
59
60     I18n.enforce_available_locales = false
61
62     # Before using the filesystem backend for Rails.cache, check
63     # whether we own the relevant directory. If we don't, using it is
64     # likely to either fail or (if we're root) pollute it and cause
65     # other processes to fail later.
66     default_cache_path = Rails.root.join('tmp', 'cache')
67     if not File.owned?(default_cache_path)
68       if File.exist?(default_cache_path)
69         why = "owner (uid=#{File::Stat.new(default_cache_path).uid}) " +
70           "is not me (uid=#{Process.euid})"
71       else
72         why = "does not exist"
73       end
74       STDERR.puts("Defaulting to memory cache, " +
75                   "because #{default_cache_path} #{why}")
76       config.cache_store = :memory_store
77     end
78   end
79 end