diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-22 18:22:54 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-22 18:23:38 -0800 |
commit | 3e64336647fefe598ff3b0775401e2c2c5d378d3 (patch) | |
tree | 05eabd9c5ace4f7283f53fcb909623a1ae2a3240 /activerecord/lib/active_record | |
parent | 6ca921a98cefa2bce67486f1ba2a8f52f4170d78 (diff) | |
download | rails-3e64336647fefe598ff3b0775401e2c2c5d378d3.tar.gz rails-3e64336647fefe598ff3b0775401e2c2c5d378d3.tar.bz2 rails-3e64336647fefe598ff3b0775401e2c2c5d378d3.zip |
removing SQL interpolation, please use scoping and attribute conditionals as a replacement
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/association_preload.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb index 9ac792fe3f..fc7c544a55 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -389,14 +389,9 @@ module ActiveRecord end end - - def interpolate_sql_for_preload(sql) - instance_eval("%@#{sql.gsub('@', '\@')}@", __FILE__, __LINE__) - end - def append_conditions(reflection, preload_options) sql = "" - sql << " AND (#{interpolate_sql_for_preload(reflection.sanitized_conditions)})" if reflection.sanitized_conditions + sql << " AND (#{reflection.sanitized_conditions})" if reflection.sanitized_conditions sql << " AND (#{sanitize_sql preload_options[:conditions]})" if preload_options[:conditions] sql end |