diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-03 00:46:39 +0530 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-03 00:56:20 +0530 |
commit | 0e3700364c98fe8f766fea8d711795dfe15e7ff0 (patch) | |
tree | eaf4a6080e62dbec12a4cfce0e5b102c74b1ad4f /activerecord/lib/active_record/associations/builder | |
parent | a95cbabc358a6f221b288f93fd8d48d769f6d23b (diff) | |
download | rails-0e3700364c98fe8f766fea8d711795dfe15e7ff0.tar.gz rails-0e3700364c98fe8f766fea8d711795dfe15e7ff0.tar.bz2 rails-0e3700364c98fe8f766fea8d711795dfe15e7ff0.zip |
Dropped deprecated option `:restrict` for `:dependent` in associations
Diffstat (limited to 'activerecord/lib/active_record/associations/builder')
3 files changed, 2 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index 3254da4677..bbc1c20f60 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -104,13 +104,6 @@ module ActiveRecord::Associations::Builder raise ArgumentError, "The :dependent option must be one of #{valid_dependent_options}, but is :#{options[:dependent]}" end - if options[:dependent] == :restrict - ActiveSupport::Deprecation.warn( - "The :restrict option is deprecated. Please use :restrict_with_exception instead, which " \ - "provides the same functionality." - ) - end - n = name model.before_destroy lambda { |o| o.association(n).handle_dependency } end diff --git a/activerecord/lib/active_record/associations/builder/has_many.rb b/activerecord/lib/active_record/associations/builder/has_many.rb index 0d1bdd21ee..a60cb4769a 100644 --- a/activerecord/lib/active_record/associations/builder/has_many.rb +++ b/activerecord/lib/active_record/associations/builder/has_many.rb @@ -9,7 +9,7 @@ module ActiveRecord::Associations::Builder end def valid_dependent_options - [:destroy, :delete_all, :nullify, :restrict, :restrict_with_error, :restrict_with_exception] + [:destroy, :delete_all, :nullify, :restrict_with_error, :restrict_with_exception] end end end diff --git a/activerecord/lib/active_record/associations/builder/has_one.rb b/activerecord/lib/active_record/associations/builder/has_one.rb index 0da564f402..2406437a07 100644 --- a/activerecord/lib/active_record/associations/builder/has_one.rb +++ b/activerecord/lib/active_record/associations/builder/has_one.rb @@ -19,7 +19,7 @@ module ActiveRecord::Associations::Builder end def valid_dependent_options - [:destroy, :delete, :nullify, :restrict, :restrict_with_error, :restrict_with_exception] + [:destroy, :delete, :nullify, :restrict_with_error, :restrict_with_exception] end end end |