diff options
Diffstat (limited to 'activesupport/lib/active_support/railtie.rb')
-rw-r--r-- | activesupport/lib/active_support/railtie.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index aa8d408da9..29351db742 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -27,6 +27,15 @@ module ActiveSupport Time.zone_default = zone_default end + # Sets the default week start + # If assigned value is not a valid day symbol (e.g. :sunday, :monday, ...), an exception will be raised. + initializer "active_support.initialize_beginning_of_week" do |app| + require 'active_support/core_ext/date/calculations' + beginning_of_week_default = Date.find_beginning_of_week!(app.config.beginning_of_week) + + Date.beginning_of_week_default = beginning_of_week_default + end + initializer "active_support.set_configs" do |app| app.config.active_support.each do |k, v| k = "#{k}=" |