-
Notifications
You must be signed in to change notification settings - Fork 195
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
there seems to be an issue with parent_class_name #83
Comments
Did you ever figure this out @kdabalos? I'm using same Rails version and master branch too. |
i got the same issue, as i understood the code below is used for STI models, so if your class isn't STI model this function will return
i solved this by adding all non STI Model to initialiser like this |
actually this is mentioned in the doc, i didn't see that before now |
I did this as well, but I was seeing weird functionality. Sometimes it would create a record with I ended up forking this repo, and changed the code to only using 'User' as the followable_type. This isn't ideal since it isn't reusable for other model types, but I couldn't think of a better/quicker solution since I had beat my head on this for far too long. |
Yeah, I think it does. This should be safe to close. |
my classes look like the following
For some reason when I call this method user.follow(policy), the followable_type is not set to 'Policy' but to 'ApplicationRecord' which makes user.following?(policy) always return false. I looked at the parent_class_name method. the code below executes because the
include?
method returns false even ifobj.class.superclass.name == 'ApplicationRecord'
I use Rails 5 and the master branch as indicated in another issue #79
The text was updated successfully, but these errors were encountered: