lib/ransack/constants.rb in ransack-0.7.1 vs lib/ransack/constants.rb in ransack-0.7.2

- old
+ new

@@ -19,11 +19,11 @@ ['null', {:arel_predicate => 'eq', :compounds => false, :type => :boolean, :validator => proc {|v| TRUE_VALUES.include?(v)}, :formatter => proc {|v| nil}}], ['not_null', {:arel_predicate => 'not_eq', :compounds => false, :type => :boolean, :validator => proc {|v| TRUE_VALUES.include?(v)}, :formatter => proc {|v| nil}}] ] module_function - # replace % _ \ to \% \_ \\ + # replace % \ to \% \\ def escape_wildcards(unescaped) - unescaped.gsub(/\\/){ "\\\\" }.gsub(/%/, "\\%").gsub(/_/, "\\_") + unescaped.gsub(/\\/){ "\\\\" }.gsub(/%/, "\\%") end end -end \ No newline at end of file +end