You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
Hello, I will be brief to save time. I hope you can help me.
For development reasons I am trying to monkey patch a model class >Card< inside a script file dev.rb which i am trying to load from the pry console.
I am receiving this error:
NoMethodError: undefined method `relations' for Card:Class
It was happening irregularly and I finally noticed, that if I try to monkey patch it before some call to the Card class was issued, the error shows up. If I just insert a call to Card right before the patching, it works.
I don't know if I am missing something here, or if this is intended behaviour that I am ignorant about.
Thank you!
Update: I tried to reproduce once again and suddenly the error has changed. I receive:
NoMethodError: undefined method `first' for Card:Class
when trying to receive the first entry from the database after I loaded the dev.rb file with the monkey patch. Again, issuing a call to Card before loading the script prevents the error.
This seems like some sort of lazy loading that I don't know about.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, I will be brief to save time. I hope you can help me.
For development reasons I am trying to monkey patch a model class >Card< inside a script file dev.rb which i am trying to load from the pry console.
I am receiving this error:
NoMethodError: undefined method `relations' for Card:Class
It was happening irregularly and I finally noticed, that if I try to monkey patch it before some call to the Card class was issued, the error shows up. If I just insert a call to Card right before the patching, it works.
I don't know if I am missing something here, or if this is intended behaviour that I am ignorant about.
Thank you!
Update: I tried to reproduce once again and suddenly the error has changed. I receive:
NoMethodError: undefined method `first' for Card:Class
when trying to receive the first entry from the database after I loaded the dev.rb file with the monkey patch. Again, issuing a call to Card before loading the script prevents the error.
This seems like some sort of lazy loading that I don't know about.
The text was updated successfully, but these errors were encountered: