SQL error in migrations - adding data

hi.

i’m getting this weird error:
Mysql::Error: #42S22Unknown column ‘categories_count’ in ‘field list’:
UPDATE categories SET categories_count = categories_count + 1 WHERE (id
= 9) AND ( (categories.type = ‘State’ ) )

i’m using a single table inheritance, so in my model i have:
class Category < ActiveRecord::Base
end

class State < Category #works
end

class Ca < Category # getting the error message above when migrating new
data into the existing Categories data.

Any help would help my poor fingers and brain.

Thanks

Dominic

Ok, i think the problem is that i’m trying to use a single table
inheritance method with an acts as tree (all in one table)

i’m dividing out each parent into it’s own inherited model…

is there a proper way to do this?

Dominic S. wrote:

hi.

i’m getting this weird error:
Mysql::Error: #42S22Unknown column ‘categories_count’ in ‘field list’:
UPDATE categories SET categories_count = categories_count + 1 WHERE (id
= 9) AND ( (categories.type = ‘State’ ) )

i’m using a single table inheritance, so in my model i have:
class Category < ActiveRecord::Base
end

class State < Category #works
end

class Ca < Category # getting the error message above when migrating new
data into the existing Categories data.

Any help would help my poor fingers and brain.

Thanks

Dominic

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs