aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-18 08:00:45 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-18 08:00:45 -0700
commit5428de1efd695fa171779dbbacf718e1be60d63e (patch)
tree3d82f95cb9b2d6eecb4859891c06f19b7e9b92a5 /railties
parentbfcbaa55478577dafe4fa59c046e65e403451d04 (diff)
parentda26dfbefdccac4ab1f3195ae747685d2b11be13 (diff)
downloadrails-5428de1efd695fa171779dbbacf718e1be60d63e.tar.gz
rails-5428de1efd695fa171779dbbacf718e1be60d63e.tar.bz2
rails-5428de1efd695fa171779dbbacf718e1be60d63e.zip
Merge pull request #5339 from gregolsen/week_start_config
week_start option added to rails app config
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application/configuration.rb3
-rw-r--r--railties/test/application/configuration_test.rb22
2 files changed, 24 insertions, 1 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index c4c1fcca40..580d7c6c77 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -13,7 +13,7 @@ module Rails
:railties_order, :relative_url_root, :secret_token,
:serve_static_assets, :ssl_options, :static_cache_control, :session_options,
:time_zone, :reload_classes_only_on_change,
- :queue, :queue_consumer
+ :queue, :queue_consumer, :beginning_of_week
attr_writer :log_level
attr_reader :encoding
@@ -31,6 +31,7 @@ module Rails
@session_store = :cookie_store
@session_options = {}
@time_zone = "UTC"
+ @beginning_of_week = :monday
@log_level = nil
@middleware = app_middleware
@generators = app_generators
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 039b08c723..428c90afd0 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -445,6 +445,28 @@ module ApplicationTests
end
end
+ test "valid beginning of week is setup correctly" do
+ add_to_config <<-RUBY
+ config.root = "#{app_path}"
+ config.beginning_of_week = :wednesday
+ RUBY
+
+ require "#{app_path}/config/environment"
+
+ assert_equal :wednesday, Rails.application.config.beginning_of_week
+ end
+
+ test "raises when an invalid beginning of week is defined in the config" do
+ add_to_config <<-RUBY
+ config.root = "#{app_path}"
+ config.beginning_of_week = :invalid
+ RUBY
+
+ assert_raise(ArgumentError) do
+ require "#{app_path}/config/environment"
+ end
+ end
+
test "config.action_controller.perform_caching = false" do
make_basic_app do |app|
app.config.action_controller.perform_caching = false