https://avo.cool logo
just found a fun issue... Using avo breaks runn...
# avo-2
a
just found a fun issue... Using avo breaks running
bin/rails db:drop db:create db:migrate db:seed
because avo's routes eagerly load all resources, and then all model classes for those resources
m
Thread automatically created by segiddins in #740893011994738751
l
Hello @alert-monkey-67616. What specificaly breaks? I use it quite offten and the only thing that I get sometimes is
PG::ObjectInUse: ERROR:  database "XPTO" is being accessed by other users
To pass that I usually do
rails restart && rails db:drop db:create db:migrate db:seed
a
turns out it was good jobs breaking things, but in general i think it would be really nice to not eagerly load every single model class in the app
l
I wonder what triggers the eager loading of the models?
I mean, we eager load our stuff
you coudl try to use
self.model_class = "User"
with a string instead of a class. it should get constantized automatically AFAIR
maybe that does not trigger the eager load
a
I believe it’s getting the route key from Naming that triggers it
l
I'll prepare that OSS guide for you for Avo 3
I think it's best you guys upgrade as soon as you can
a
❤️