]> git.openstreetmap.org Git - rails.git/blob - config/application.rb
Force translations to be preloaded during startup
[rails.git] / config / application.rb
1 require File.expand_path('../boot', __FILE__)
2
3 require File.expand_path('../preinitializer', __FILE__)
4
5 if STATUS == :database_offline
6 require "action_controller/railtie"
7 require "action_mailer/railtie"
8 require "active_resource/railtie"
9 require "sprockets/railtie"
10 require "rails/test_unit/railtie"
11 else
12 require 'rails/all'
13 end
14
15 if defined?(Bundler)
16   # If you precompile assets before deploying to production, use this line
17   Bundler.require(*Rails.groups(:assets => %w(development test)))
18   # If you want your assets lazily compiled in production, use this line
19   # Bundler.require(:default, :assets, Rails.env)
20 end
21
22 module OpenStreetMap
23   class Application < Rails::Application
24     # Settings in config/environments/* take precedence over those specified here.
25     # Application configuration should go into files in config/initializers
26     # -- all .rb files in that directory are automatically loaded.
27
28     # Custom directories with classes and modules you want to be autoloadable.
29     config.autoload_paths += %W(#{config.root}/lib)
30
31     # Only load the plugins named here, in the order given (default is alphabetical).
32     # :all can be used as a placeholder for all plugins not explicitly named.
33     # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
34
35     # Activate observers that should always be running.
36     unless STATUS == :database_offline
37       config.active_record.observers = :spam_observer
38     end
39
40     # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
41     # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
42     # config.time_zone = 'Central Time (US & Canada)'
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 the default encoding used in templates for Ruby 1.9.
49     config.encoding = "utf-8"
50
51     # Configure sensitive parameters which will be filtered from the log file.
52     config.filter_parameters += [:password, :pass_crypt, :pass_crypt_confirmation]
53
54     # Use SQL instead of Active Record's schema dumper when creating the database.
55     # This is necessary if your schema can't be completely dumped by the schema dumper,
56     # like if you have constraints or database-specific column types
57     unless STATUS == :database_offline
58       config.active_record.schema_format = :sql
59     end
60
61     # Enforce whitelist mode for mass assignment.
62     # This will create an empty whitelist of attributes available for mass-assignment for all models
63     # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
64     # parameters by using an attr_accessible or attr_protected declaration.
65     unless STATUS == :database_offline
66       config.active_record.whitelist_attributes = true
67     end
68
69     # Enable the asset pipeline
70     config.assets.enabled = true
71
72     # Version of your assets, change this if you want to expire all your assets
73     config.assets.version = '1.0'
74
75     # Don't eager load models when the database is offline
76     if STATUS == :database_offline
77       config.paths["app/models"].skip_eager_load!
78     end
79   end
80 end