I need to do a scope where I find all files that have certain extensions - my current non-functional attempt is this:
scope :visual, where(%w[.gif .jpg .jpeg .tif .tiff].include? File.extname(item_file_name), true)
This attempt gives me errors - how do you create scopes where the conditions are not just a straight SQL query?