column named "key"

There didn't seem to be a question here but assume you want to know how to select a column with a reserved word.

This issue has some examples Order method should quote column names · Issue #2601 · rails/rails · GitHub Looks like using a symbol or double quoting it should work.