igorkasyanchuk / rails_db

Rails Database Viewer and SQL Query Runner
https://www.railsjazz.com/
MIT License
1.46k stars 111 forks source link

Explicitly initialize ActiveRecord #95

Closed cmrd-senya closed 5 years ago

cmrd-senya commented 5 years ago

I'm developing a Rails application which is using Sequel ORM and which doesn't use ActiveRecord. rails_db depends on ActiveRecord and assumes that ActiveRecord is initialized which is not the case for some RoR applications (like mine).

After these changes rails_db worked for me.

I think that rails_db should manage its dependency on activerecord on its own instead of just assuming that it is already initialized by the host application. While this is true for majority of RoR apps, this is not the case for some of them. Simple inclusion of ActiveRecord as a dependency fixes the issue for the case with no harm for others.

igorkasyanchuk commented 5 years ago

thank you for fixing this issue. new version just released: rails_db-2.0.6.gem

cmrd-senya commented 5 years ago

Thanks for the fast merge!