Permalink
Browse files

config.active_record.whiny_protected_attributes. Closes #9816 [henrik]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7807 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 1c90758 commit 9929cb4ec23e1f89177f174841d3f92ec212b4e2 @jeremy jeremy committed Oct 8, 2007
Showing with 1 addition and 21 deletions.
  1. +1 −1 railties/environments/production.rb
  2. +0 −20 railties/lib/initializer.rb
@@ -18,4 +18,4 @@
# config.action_mailer.raise_delivery_errors = false
# Disable raising errors when mass-assigning to a protected attribute
-config.whiny_protected_attributes = false
+config.active_record.whiny_protected_attributes = false
@@ -72,7 +72,6 @@ def initialize(configuration)
# * #initialize_framework_views
# * #initialize_dependency_mechanism
# * #initialize_whiny_nils
- # * #initialize_whiny_protected_attributes
# * #initialize_temporary_directories
# * #initialize_framework_settings
# * #add_support_load_paths
@@ -96,7 +95,6 @@ def process
initialize_framework_views
initialize_dependency_mechanism
initialize_whiny_nils
- initialize_whiny_protected_attributes
initialize_temporary_directories
initialize_framework_settings
@@ -300,14 +298,6 @@ def initialize_dependency_mechanism
def initialize_whiny_nils
require('active_support/whiny_nil') if configuration.whiny_nils
end
-
- # Sets +ActiveRecord::Base#whiny_protected_attributes+ which determines whether to
- # raise on mass-assigning attributes protected with +attr_protected+/+attr_accessible+.
- def initialize_whiny_protected_attributes
- if configuration.frameworks.include?(:active_record)
- ActiveRecord::Base.whiny_protected_attributes = configuration.whiny_protected_attributes
- end
- end
def initialize_temporary_directories
if configuration.frameworks.include?(:action_controller)
@@ -433,11 +423,6 @@ class Configuration
# Set to +true+ if you want to be warned (noisily) when you try to invoke
# any method of +nil+. Set to +false+ for the standard Ruby behavior.
attr_accessor :whiny_nils
-
- # The default value of +true+ means an exception will be raised on attempts
- # to mass-assign to protected attributes. Set to +false+ to discard them
- # without raising (an error will be logged instead).
- attr_accessor :whiny_protected_attributes
# The list of plugins to load. If this is set to <tt>nil</tt>, all plugins will
# be loaded. If this is set to <tt>[]</tt>, no plugins will be loaded. Otherwise,
@@ -486,7 +471,6 @@ def initialize
self.controller_paths = default_controller_paths
self.cache_classes = default_cache_classes
self.whiny_nils = default_whiny_nils
- self.whiny_protected_attributes = default_whiny_protected_attributes
self.plugins = default_plugins
self.plugin_paths = default_plugin_paths
self.plugin_locators = default_plugin_locators
@@ -646,10 +630,6 @@ def default_cache_classes
def default_whiny_nils
false
end
-
- def default_whiny_protected_attributes
- true
- end
def default_plugins
nil

0 comments on commit 9929cb4

Please sign in to comment.