‘type’ is the column name used in single table inheritance, so you
can’t use it as a basic column name. Tripped me up a bit the first
time around as well.
There is some predefined tables and classes used in
Ruby-Rails, I have once a table “search” and rails
have already defined that table. so it has never my
“table” which has been used. I think it may be the
same case…
I had the same problem as you. I had to change my column to ‘category’
instead.
When you do .type you get the class type. So I guess that this
is why it doesn’t work. The name of your column is clashing with the
Object variable type.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.