Skip to content

Unknown primary key for table page_hierarchies in model PageHierarchy #294

Open
@mcmegavolt

Description

@mcmegavolt

I'm using rails 5.1.4 with activeadmin

When try to load pages index in ActiveAdmin got the error

Showing /home/ap/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activeadmin-1.2.0/app/views/active_admin/resource/index.html.arb where line #2 raised:

Unknown primary key for table page_hierarchies in model PageHierarchy.

def primary_key(klass)
  klass.primary_key || raise(UnknownPrimaryKey.new(klass))
end

My page model

class Page < ApplicationRecord
  ...
  has_closure_tree order: 'sort_order'
  ...
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions