We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4deef91 commit d05a5cdCopy full SHA for d05a5cd
1 file changed
app/models/tag.rb
@@ -49,7 +49,7 @@ def self.search(term)
49
50
# Select from the union of the above queries, select only the tag columns such that we can distinct them
51
from(Arel.sql("((#{q1.to_sql}) UNION (#{q2.to_sql})) tags"))
52
- .order(Arel.sql(sanitize_sql_array(['name LIKE ? DESC, name', value])))
+ .order(Arel.sql(sanitize_sql_array(['name LIKE ? DESC, char_length(name), name', value])))
53
.select(Tag.column_names.map { |c| "tags.#{c}" })
54
.distinct
55
end
0 commit comments