filetype comparison needs to be case insensitive

This commit is contained in:
Jeff Atwood 2017-07-22 13:18:15 -07:00
parent e2e0221dd7
commit bc9270defb
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ SQL
builder.where('ftl.topic_id = :topic_id', topic_id: topic_id)
builder.where('ft.deleted_at IS NULL')
builder.where("NOT(ftl.url LIKE '%.png' OR ftl.url LIKE '%.jpg' OR ftl.url LIKE '%.gif')")
# note that ILIKE means "case insensitive LIKE"
builder.where("NOT(ftl.url ILIKE '%.png' OR ftl.url ILIKE '%.jpg' OR ftl.url ILIKE '%.gif')")
builder.where("COALESCE(ft.archetype, 'regular') <> :archetype", archetype: Archetype.private_message)
builder.secure_category(guardian.secure_category_ids)