Generator not respecting abstract_class
Created by: lukeredpath
I'm trying to set up Administrate with a new Rails 5 project, using the as yet unmerged compatibility branch.
The administrate:install generator fails with the error:
WARNING: Unable to generate a dashboard for ApplicationRecord.
It is not connected to a database table.
Make sure your database migrations are up to date.
create app/controllers/admin/application_controller.rb
create app/dashboards/_dashboard.rb
/Users/luke/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/generators/named_base.rb:102:in `map!': undefined method `camelize' for nil:NilClass (NoMethodError)
Its possible this isn't a Rails 5 compatibility issue but something that has surfaced due to Rails including ApplicationRecord, an abstract sub-class of ActiveRecord::Base, by default.
Also mentioned on #575
Not sure if this is related, but I also ended up with an empty "_dashboard.rb" file. After looking at the generator code I notice that if I run Administrate::Namespace.new(:admin).resources
on the console it returns [:""]
.