Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5 - Gives Warning for no ApplicationRecord dashboard #639

Closed
bjkeeton opened this issue Aug 5, 2016 · 9 comments
Closed

Rails 5 - Gives Warning for no ApplicationRecord dashboard #639

bjkeeton opened this issue Aug 5, 2016 · 9 comments

Comments

@bjkeeton
Copy link

bjkeeton commented Aug 5, 2016

I noticed when using the Rails5 beta that the following warning comes up:


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.

Since ApplicationRecord will never be connected to a database, the warning is pointless.

Right now, I feel as though I know enough to be dangerous, but I can't figure out how to get this to go through and pass (or even if the test/fix is correct). Anyone know a quick fix for this one, or can point out what I'm doing wrong?

My fork is here, with my ideas, but I can't get the tests to pass because I'm not 100% on the syntax at this point: https://github.com/GeekFitness/administrate

@cies
Copy link

cies commented Aug 6, 2016

I saw that error and got another one myself:

% rails generate administrate:install
Running via Spring preloader in process 16597
   identical  app/controllers/admin/application_controller.rb
/home/cies/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/generators/named_base.rb:106:in `map!': undefined method `camelize' for nil:NilClass (NoMethodError)
[...]

But maybe that's due to me having a bunch of tables in my postgres without having AR models for them (otherwise is is a freshly scaffolded rails 5 app). I'll retry on an empty db.

@cies
Copy link

cies commented Aug 6, 2016

Once I started with a clean scaffolded rails 5 app, with only a scaffolded Post model. Then it "just worked".

@cies
Copy link

cies commented Aug 6, 2016

Now I run into this problem:

 Showing ~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/administrate-c4922bf12435/app/views/administrate/application/index.html.erb where line #31 raised:

File to import not found or unreadable: bourbon.

@bjkeeton
Copy link
Author

bjkeeton commented Aug 6, 2016

Cies, I get

File to import not found or unreadable: bourbon.

When I do it, too. I actually moved off that branch and went on to another project because nothing I could do would fix it, even different version of bourbon.

My gemfile was the one suggested:

gem 'administrate', github: 'greetpoint/administrate', branch: 'rails5'
gem 'bourbon', '~> 5.0.0.beta.5' 

I event tried normal bourbon, too.

@cies
Copy link

cies commented Aug 7, 2016

I got:

gem "administrate", git: "https://github.com/thoughtbot/administrate.git", branch: "rails-5"
gem "bourbon"
gem "neat"

Fixed the bourbon issue, but I got the feeling not all is working well yet (missing the experience with a good working version of administrate to make solid claims).

I think I go with rails 4 and administrate -- @bjkeeton what project did you go with?

@bjkeeton
Copy link
Author

bjkeeton commented Aug 7, 2016

I'm still using Rails 5 for the project, I think. I haven't made a CMS decision yet, but if you've solved the bourbon issue, I will give this a shot and see.

EDIT: Still didn't fix it. Tried gem 'bourbon' and the beta one.
administrate

@ahanmal
Copy link

ahanmal commented Aug 8, 2016

I also ran into issues using Rails 5 and Bourbon. Bourbon 5.0 beta changes many things, so when I integrated administrate, which required me to go back to the 4.2 Bourbon version but broke my previous application completely. But to get the bourbon working, you need to change the Bourbon dependency in the gemspec to allow version 5.0. It seemed to bundle correctly, but I haven't really tried to check if everything else works.

@bjkeeton
Copy link
Author

Now I'm getting this error when going back with a clean application:

adnimistrate2

@JoelQ
Copy link
Contributor

JoelQ commented Oct 28, 2016

There are two issues happening here.

  1. Bourbon problems. There an issue ( Dependency on bourbon not listed #615 ) for this problem.
  2. Dashboard problems. These happen because your administrate tries to generate dashboards for all your models but can only actually work with database-backed models. To fix delete references to non-database-backed dashboards from your dashboards.rb file.

I'm going to close the issue but feel free to continue discussing Bourbon issues on #615

@JoelQ JoelQ closed this as completed Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants