aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/core.rb
diff options
context:
space:
mode:
authorManoj <manoj.mk27@gmail.com>2012-01-28 00:18:59 +0530
committerManoj <manoj.mk27@gmail.com>2012-01-29 15:28:22 +0530
commit336ff8a97e9391d4111e923a9b841376110d04c9 (patch)
tree5590b3f9b97cf896f26bb641a474908fd20d873f /activerecord/lib/active_record/core.rb
parentfd3211ef677efe9531f38db58919a8c90d65892a (diff)
downloadrails-336ff8a97e9391d4111e923a9b841376110d04c9.tar.gz
rails-336ff8a97e9391d4111e923a9b841376110d04c9.tar.bz2
rails-336ff8a97e9391d4111e923a9b841376110d04c9.zip
has_many/has_one, :dependent => :restrict, deprecation added.
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r--activerecord/lib/active_record/core.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index a774af6024..a2ce620354 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -72,6 +72,16 @@ module ActiveRecord
# The connection handler
config_attribute :connection_handler
self.connection_handler = ConnectionAdapters::ConnectionHandler.new
+
+ ##
+ # :singleton-method:
+ # Specifies wether or not has_many or has_one association option
+ # :dependent => :restrict raises an exception. If set to true, the
+ # ActiveRecord::DeleteRestrictionError exception will be raised
+ # along with a DEPRECATION WARNING. If set to false, an error would
+ # be added to the model instead.
+ config_attribute :dependent_restrict_raises, :global => true
+ self.dependent_restrict_raises = true
end
module ClassMethods