diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-05-05 17:04:21 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-05-05 17:04:21 +0200 |
commit | 19ba522b90f4b3e5daf469fbbccce708a8cc70ce (patch) | |
tree | fc2b40fd2824001064925ed318648caf0dd8fddb /activerecord | |
parent | fb898e986f8da1943e293e9c42d8c2e1aa4525d6 (diff) | |
download | rails-19ba522b90f4b3e5daf469fbbccce708a8cc70ce.tar.gz rails-19ba522b90f4b3e5daf469fbbccce708a8cc70ce.tar.bz2 rails-19ba522b90f4b3e5daf469fbbccce708a8cc70ce.zip |
[ci skip] Don't promote SQL interpolation.
After fb898e9, the `before_destroy` had some code that used
SQL interpolation left over. Don't think we should promote
that even if the values aren't directly from user input.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/callbacks.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 7c4f1b2bb3..5d4d9379f0 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -54,8 +54,8 @@ module ActiveRecord # # class Firm < ActiveRecord::Base # # Destroys the associated clients and people when the firm is destroyed - # before_destroy { |record| Person.where("firm_id = #{record.id}").destroy_all } - # before_destroy { |record| Client.where("client_of = #{record.id}").destroy_all } + # before_destroy { |record| Person.where(firm_id: record.id).destroy_all } + # before_destroy { |record| Client.where(client_of: record.id).destroy_all } # end # # == Inheritable callback queues |