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

Ignore ActiveRecord tables without associated model. #139

Open
svenihoney opened this issue Dec 15, 2014 · 1 comment
Open

Ignore ActiveRecord tables without associated model. #139

svenihoney opened this issue Dec 15, 2014 · 1 comment
Labels

Comments

@svenihoney
Copy link

If I activate the ActiveRecord session store as shown on https://github.com/rails/activerecord-session_store, upmin bails out with an "uninitialized constant Upmin::ActiveRecord::SessionStore" with the following exception:

(eval):3:in `model_class'
/tmp/upmin-admin-ruby/lib/upmin/model.rb:165:in `model_class_name'
/tmp/upmin-admin-ruby/lib/upmin/model.rb:189:in `search_path'
/tmp/upmin-admin-ruby/app/views/layouts/upmin/_navbar.html.haml:14:in `block in __tmp_upmin_admin_ruby_app_views_layouts_upmin__navbar_html_haml___3179528665945118893_70041221274420'
/tmp/upmin-admin-ruby/app/views/layouts/upmin/_navbar.html.haml:12:in `each'
/tmp/upmin-admin-ruby/app/views/layouts/upmin/_navbar.html.haml:12:in `__tmp_upmin_admin_ruby_app_views_layouts_upmin__navbar_html_haml___3179528665945118893_70041221274420'
vendor/bundle/ruby/2.1.0/gems/actionview-4.2.0.rc2/lib/action_view/template.rb:145:in `block in render'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.rc2/lib/active_support/notifications.rb:166:in `instrument'

This can be reproduced in my application as well as with a freshly checked out test app active_record42 from github. I use ruby 2.1.5 with rbenv.

Is there any place where additional configuration has to be done? As soon as I remove the session store gem from the Gemfile, upmin is back working.

Regards,
Sven

@mbrookes
Copy link
Contributor

Hi Sven,

Yes, ActiveRecord tables without an associated model will break things, so you have to whitelist your models with config.models

This has come up a couple of times now in different forms (there's PR #126 for HABTM tables for example), so I'm thinking we might need to be smarter about what gets counted as a model by default.

@mbrookes mbrookes changed the title Upmin refuses to start with ActiveRecord session store Ignore ActiveRecord tables without associated model. Dec 16, 2014
@mbrookes mbrookes added the bug label Dec 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants