diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-01 12:12:07 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-01 12:12:07 -0700 |
commit | 7d2df5fa62da393e429393ccd161d237117932fd (patch) | |
tree | 1b3c669232c182b0cba0a9ac9e1fc1eee824493e /activerecord/lib/active_record | |
parent | b2a24a15785e94078bae87946ffa43bc59bccfec (diff) | |
parent | 2f681254ee9481f30baa53720c1570decb437725 (diff) | |
download | rails-7d2df5fa62da393e429393ccd161d237117932fd.tar.gz rails-7d2df5fa62da393e429393ccd161d237117932fd.tar.bz2 rails-7d2df5fa62da393e429393ccd161d237117932fd.zip |
Merge pull request #6089 from frodsan/delete_all_limit
delete_all raise an error if a limit is provided - fixes #4979
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 333d31d8a3..779e052e3c 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -390,6 +390,8 @@ module ActiveRecord # If you need to destroy dependent associations or call your <tt>before_*</tt> or # +after_destroy+ callbacks, use the +destroy_all+ method instead. def delete_all(conditions = nil) + raise ActiveRecordError.new("delete_all doesn't support limit scope") if self.limit_value + if conditions where(conditions).delete_all else |