-
Notifications
You must be signed in to change notification settings - Fork 131
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
Incompatible with gems that call attribute
in Rails models
#2004
Comments
Looks like it's being thrown from tapioca/lib/tapioca/runtime/reflection.rb Lines 49 to 53 in 316688e
It might be fine to add ActiveRecord::ConnectionNotEstablished to the rescue list and skip this constant. I'm not sure if there's anything else we can do.
If |
I am having a similar issue when running the |
I am having the same issue with gem |
A solution is being worked on in #2116 |
Thank you for the update @KaanOzkan. I appreciate you taking a look at this issue. |
I'm not sure if this is an issue with tapioca or with the downstream gem, but figured I'd report here and you can tell me to go away if necessary :)
To replicate:
rails new tapioca-bug
gem "noticed", "2.4.1"
to Gemfilegem 'tapioca', require: false
to Gemfilebundle exec tapioca init
It will raise like this:
The issue is the
, :json
here. If you remove that, it works fine, since it doesn't need to do the type lookup anymore.As far as I'm aware, that approach of putting models in
app/models
for a gem is valid, but maybe there's a more correct way to structure the gem. In any case, it works fine everywhere apart from this specific case.The underlying issue, I think, is that Rails thinks there's no connection pool set up. This is not an issue when you boot a Rails app, it's only an issue when tapioca is eager loading.
cc @excid3
The text was updated successfully, but these errors were encountered: