How to cast a string of comma separated numbers into an array of integers for Postgres
If you have an string of numbers like
and you want to turn it into an array of integers you need to cast it into an integer array type.
This is commonly used together when grabbing a set using the ANY clause.
How To Get A List of All Registered Mime Types in Rails
When mime types are registered they are placed in a hash constant EXTENSION_LOOKUP in the module Mime. For reference, the file with the relevant code is in rails/action_pack/lib/action_dispatch/http/mime_type.rb available on Github at https://github.com/r...