Error in rails Object does not support #inspect with table name with reserved word in mysql

1

The name of the table is "char" which is a reserved word in mysql, how can I correct the error without having to change the name of the table?

I can not change the name of the table because it is from the game ragnarok

In the model (Character.rb)

self.table_name = "char"

On the console

d = Character.all
Character Load (0.3ms)  SELECT 'char'.* FROM 'char'
(Object doesn't support #inspect)
=>  

In index.html.erb

undefined method 'define_attribute_methods' for 0:Fixnum
    
asked by manuel_m2 10.12.2016 в 03:07
source

0 answers