2

Update #1: Solved! Somehow Pow did not restart it's processes, so after updates it was loading the old config files. And it was loading the wrong locale file.

I deleted gems I installed recently (only from Gemfile) and restarted Pow. Then one by one I added gems back to the Gemfile. As well ActiveAdmin as Rails localization started working normally.

Original question:

I am trying to setup ActiveAdmin to support my taxonomies. My setup is as following:

class Taxonomy < ActiveRecord::Base
end

class Category < Taxonomy
  has_ancestry # implements a tree of categories
end

class Tag < Taxonomy
end

So now I added the following to ActiveAdmin:

ActiveAdmin.register Category do
end

And it returns the folioing error:

Could not find table 'categories'

My migrations were definitely ran. And I have some valid STI records in the taxonomies table. So what can be wrong?

Ivan
  • 874
  • 10
  • 32
  • Can you confirm whether the `categories` table does indeed exist? – jdd Aug 28 '11 at 12:34
  • No it doesn't. STI (Single Table Inheritance) pattern implies that you can have one table for multiple models that have (almost) same attributes. In my case attributes are `title` and `description`. However to differ between the models there **MUST** be `type` attribute. Rails will then automatically match this attribute with model name. So when I call `Category.all` I'll get the same as `Taxonomy.where(type: 'Category')`. It does work on the frontend, but it doesn't in ActiveAdmin. So maybe I forgot something. – Ivan Aug 28 '11 at 12:50
  • 1
    where you able to solve this? – Pacu Jul 05 '13 at 23:45

0 Answers0