Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

remove unused `expand_range_bind_variables` method #7875

Merged
merged 1 commit into from

3 participants

Yves Senn Rafael Mendonça França Corin Langosch
Yves Senn
Owner

this method was not used, not documented and not tested.

While I was looking through the code to implement #6984 I found that this method seems to have lost it's purpose.

Yves Senn senny remove unused `expand_range_bind_variables` method
this method was not used, not documented and not tested.
13206cc
Yves Senn
Owner

@rafaelfranca @steveklabnik do you know of any usage for this method? I think we can drop it since it's not used anywhere.

Rafael Mendonça França
Owner

Right. The last usage of this method was removed at 77c23b2

Rafael Mendonça França rafaelfranca merged commit a9bf3a4 into from
Yves Senn
Owner

@rafaelfranca thanks for the immediate response :)

Corin Langosch

@senny Did you also implement #6984? :)

Yves Senn
Owner

@gucki I did not yet finish that... let me check my local branch. My vague memory is that there was something holding me back from finishing this feature.

Yves Senn
Owner

@gucki I checked again and the issue is, that the complete Sanitization currently is on the ActiveRecord::Base level. execute however is one level deeper on the connection. At the time I did not think the necessary refactoring was justified by this feature.

Corin Langosch

@senny Thanks for the info. Imo it might be a good idea to refactor this anyway, as it doesn't really belong to ActiveRecord::Base but to the connection, don't you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 8, 2012
  1. Yves Senn

    remove unused `expand_range_bind_variables` method

    senny authored
    this method was not used, not documented and not tested.
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 17 deletions.
  1. +0 −17 activerecord/lib/active_record/sanitization.rb
17 activerecord/lib/active_record/sanitization.rb
View
@@ -141,23 +141,6 @@ def replace_named_bind_variables(statement, bind_vars) #:nodoc:
end
end
- def expand_range_bind_variables(bind_vars) #:nodoc:
- expanded = []
-
- bind_vars.each do |var|
- next if var.is_a?(Hash)
-
- if var.is_a?(Range)
- expanded << var.first
- expanded << var.last
- else
- expanded << var
- end
- end
-
- expanded
- end
-
def quote_bound_value(value, c = connection) #:nodoc:
if value.respond_to?(:map) && !value.acts_like?(:string)
if value.respond_to?(:empty?) && value.empty?
Something went wrong with that request. Please try again.