##// END OF EJS Templates
Load Engines plugin if available (closes #180)....
Jean-Philippe Lang -
r1266:09bf503fd2d4
parent child
Show More
@@ -1,92 +1,99
1 # Be sure to restart your web server when you modify this file.
1 # Be sure to restart your web server when you modify this file.
2
2
3 # Uncomment below to force Rails into production mode when
3 # Uncomment below to force Rails into production mode when
4 # you don't control web/app server and can't set it the proper way
4 # you don't control web/app server and can't set it the proper way
5 # ENV['RAILS_ENV'] ||= 'production'
5 # ENV['RAILS_ENV'] ||= 'production'
6
6
7 # Bootstrap the Rails environment, frameworks, and default configuration
7 # Bootstrap the Rails environment, frameworks, and default configuration
8 require File.join(File.dirname(__FILE__), 'boot')
8 require File.join(File.dirname(__FILE__), 'boot')
9
9
10 # Load Engine plugin if available
11 begin
12 require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
13 rescue LoadError
14 # Not available
15 end
16
10 Rails::Initializer.run do |config|
17 Rails::Initializer.run do |config|
11 # Settings in config/environments/* take precedence those specified here
18 # Settings in config/environments/* take precedence those specified here
12
19
13 # Skip frameworks you're not going to use
20 # Skip frameworks you're not going to use
14 # config.frameworks -= [ :action_web_service, :action_mailer ]
21 # config.frameworks -= [ :action_web_service, :action_mailer ]
15
22
16 # Add additional load paths for sweepers
23 # Add additional load paths for sweepers
17 config.load_paths += %W( #{RAILS_ROOT}/app/sweepers )
24 config.load_paths += %W( #{RAILS_ROOT}/app/sweepers )
18
25
19 # Force all environments to use the same logger level
26 # Force all environments to use the same logger level
20 # (by default production uses :info, the others :debug)
27 # (by default production uses :info, the others :debug)
21 # config.log_level = :debug
28 # config.log_level = :debug
22
29
23 # Use the database for sessions instead of the file system
30 # Use the database for sessions instead of the file system
24 # (create the session table with 'rake create_sessions_table')
31 # (create the session table with 'rake create_sessions_table')
25 # config.action_controller.session_store = :active_record_store
32 # config.action_controller.session_store = :active_record_store
26 config.action_controller.session_store = :PStore
33 config.action_controller.session_store = :PStore
27
34
28 # Enable page/fragment caching by setting a file-based store
35 # Enable page/fragment caching by setting a file-based store
29 # (remember to create the caching directory and make it readable to the application)
36 # (remember to create the caching directory and make it readable to the application)
30 # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
37 # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
31
38
32 # Activate observers that should always be running
39 # Activate observers that should always be running
33 # config.active_record.observers = :cacher, :garbage_collector
40 # config.active_record.observers = :cacher, :garbage_collector
34 config.active_record.observers = :message_observer
41 config.active_record.observers = :message_observer
35
42
36 # Make Active Record use UTC-base instead of local time
43 # Make Active Record use UTC-base instead of local time
37 # config.active_record.default_timezone = :utc
44 # config.active_record.default_timezone = :utc
38
45
39 # Use Active Record's schema dumper instead of SQL when creating the test database
46 # Use Active Record's schema dumper instead of SQL when creating the test database
40 # (enables use of different database adapters for development and test environments)
47 # (enables use of different database adapters for development and test environments)
41 # config.active_record.schema_format = :ruby
48 # config.active_record.schema_format = :ruby
42
49
43 # See Rails::Configuration for more options
50 # See Rails::Configuration for more options
44
51
45 # SMTP server configuration
52 # SMTP server configuration
46 config.action_mailer.smtp_settings = {
53 config.action_mailer.smtp_settings = {
47 :address => "127.0.0.1",
54 :address => "127.0.0.1",
48 :port => 25,
55 :port => 25,
49 :domain => "somenet.foo",
56 :domain => "somenet.foo",
50 :authentication => :login,
57 :authentication => :login,
51 :user_name => "redmine@somenet.foo",
58 :user_name => "redmine@somenet.foo",
52 :password => "redmine",
59 :password => "redmine",
53 }
60 }
54
61
55 config.action_mailer.perform_deliveries = true
62 config.action_mailer.perform_deliveries = true
56
63
57 # Tell ActionMailer not to deliver emails to the real world.
64 # Tell ActionMailer not to deliver emails to the real world.
58 # The :test delivery method accumulates sent emails in the
65 # The :test delivery method accumulates sent emails in the
59 # ActionMailer::Base.deliveries array.
66 # ActionMailer::Base.deliveries array.
60 #config.action_mailer.delivery_method = :test
67 #config.action_mailer.delivery_method = :test
61 config.action_mailer.delivery_method = :smtp
68 config.action_mailer.delivery_method = :smtp
62
69
63 end
70 end
64
71
65 ActiveRecord::Errors.default_error_messages = {
72 ActiveRecord::Errors.default_error_messages = {
66 :inclusion => "activerecord_error_inclusion",
73 :inclusion => "activerecord_error_inclusion",
67 :exclusion => "activerecord_error_exclusion",
74 :exclusion => "activerecord_error_exclusion",
68 :invalid => "activerecord_error_invalid",
75 :invalid => "activerecord_error_invalid",
69 :confirmation => "activerecord_error_confirmation",
76 :confirmation => "activerecord_error_confirmation",
70 :accepted => "activerecord_error_accepted",
77 :accepted => "activerecord_error_accepted",
71 :empty => "activerecord_error_empty",
78 :empty => "activerecord_error_empty",
72 :blank => "activerecord_error_blank",
79 :blank => "activerecord_error_blank",
73 :too_long => "activerecord_error_too_long",
80 :too_long => "activerecord_error_too_long",
74 :too_short => "activerecord_error_too_short",
81 :too_short => "activerecord_error_too_short",
75 :wrong_length => "activerecord_error_wrong_length",
82 :wrong_length => "activerecord_error_wrong_length",
76 :taken => "activerecord_error_taken",
83 :taken => "activerecord_error_taken",
77 :not_a_number => "activerecord_error_not_a_number"
84 :not_a_number => "activerecord_error_not_a_number"
78 }
85 }
79
86
80 ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
87 ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
81
88
82 Mime::SET << Mime::CSV unless Mime::SET.include?(Mime::CSV)
89 Mime::SET << Mime::CSV unless Mime::SET.include?(Mime::CSV)
83 Mime::Type.register 'application/pdf', :pdf
90 Mime::Type.register 'application/pdf', :pdf
84
91
85 GLoc.set_config :default_language => :en
92 GLoc.set_config :default_language => :en
86 GLoc.clear_strings
93 GLoc.clear_strings
87 GLoc.set_kcode
94 GLoc.set_kcode
88 GLoc.load_localized_strings
95 GLoc.load_localized_strings
89 GLoc.set_config(:raise_string_not_found_errors => false)
96 GLoc.set_config(:raise_string_not_found_errors => false)
90
97
91 require 'redmine'
98 require 'redmine'
92
99
General Comments 0
You need to be logged in to leave comments. Login now