fixes #1219
This commit is contained in:
@@ -308,6 +308,17 @@ class Tag < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def parse_helper_fudged(range, type)
|
||||||
|
result = parse_helper(range, type)
|
||||||
|
if result[0] == :eq
|
||||||
|
new_min = (result[1] * 0.95).to_i
|
||||||
|
new_max = (result[1] * 1.05).to_i
|
||||||
|
[:between, new_min, new_max]
|
||||||
|
else
|
||||||
|
result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def reverse_parse_helper(array)
|
def reverse_parse_helper(array)
|
||||||
case array[0]
|
case array[0]
|
||||||
when :between
|
when :between
|
||||||
@@ -464,7 +475,7 @@ class Tag < ActiveRecord::Base
|
|||||||
q[:height] = parse_helper($2)
|
q[:height] = parse_helper($2)
|
||||||
|
|
||||||
when "mpixels"
|
when "mpixels"
|
||||||
q[:mpixels] = parse_helper($2, :float)
|
q[:mpixels] = parse_helper_fudged($2, :float)
|
||||||
|
|
||||||
when "ratio"
|
when "ratio"
|
||||||
q[:ratio] = parse_helper($2, :ratio)
|
q[:ratio] = parse_helper($2, :ratio)
|
||||||
@@ -476,7 +487,7 @@ class Tag < ActiveRecord::Base
|
|||||||
q[:fav_count] = parse_helper($2)
|
q[:fav_count] = parse_helper($2)
|
||||||
|
|
||||||
when "filesize"
|
when "filesize"
|
||||||
q[:filesize] = parse_helper($2, :filesize)
|
q[:filesize] = parse_helper_fudged($2, :filesize)
|
||||||
|
|
||||||
when "source"
|
when "source"
|
||||||
q[:source] = ($2.to_escaped_for_sql_like + "%").gsub(/%+/, '%')
|
q[:source] = ($2.to_escaped_for_sql_like + "%").gsub(/%+/, '%')
|
||||||
|
|||||||
Reference in New Issue
Block a user