Re: [Rails] column named "key"

9 views
Skip to first unread message

Rob Zolkos

unread,
Jan 8, 2019, 9:04:55 AM1/8/19
to rubyonra...@googlegroups.com
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
https://github.com/rails/rails/issues/2601 Looks like using a symbol
or double quoting it should work.

On Mon, Jan 7, 2019 at 7:40 PM fugee ohu <fuge...@gmail.com> wrote:
>
> I'm trying to debug spree_preferences and found that the spree_preferences database table has a field named key If I select * then key appears in headers and rows are returned but if I explicity select key I get an error which I assume is because key is a reserved name and illegal to use
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7d5ffe8a-c444-472b-8757-27191823d7e2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages