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
The relation method actables (ActsAs::ReflectionsWithActsAs) is not documented in the README (I was about to propose a feature request for this functionality 😅, I've added a small PR to add it in there).
That aside, actables seems to only work when the default name of actable is used (it uses hardcoded where(actable_id: ...)).
I believe to make actables work with differently named relations, the ActsAs::Relations::ClassMethods needs to define a way to retrieve the as parameter, or pass it along somehow. It would also need to define a method on the class instance with the plural of what is passed to the as. Something along the lines of:
The relation method
actables
(ActsAs::ReflectionsWithActsAs) is not documented in the README (I was about to propose a feature request for this functionality 😅, I've added a small PR to add it in there).That aside,
actables
seems to only work when the default name ofactable
is used (it uses hardcodedwhere(actable_id: ...)
).So a configuration like
will not work.
I believe to make
actables
work with differently named relations, theActsAs::Relations::ClassMethods
needs to define a way to retrieve theas
parameter, or pass it along somehow. It would also need to define a method on the class instance with the plural of what is passed to theas
. Something along the lines of:I'm afraid I do not quite know how to do that, or I would suggest a pull request myself. However, perhaps it is possible for you to add this?
The text was updated successfully, but these errors were encountered: