Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Recommend model in module/engine #53

Open
jbfeldis opened this Issue · 3 comments

2 participants

@jbfeldis

Hello David,

I'm having some trouble using recommendable with models in Forem (Forem::Post for example).

I can't just do recommends :post as no one knows that model and doing recommends "Forem::Post" works but then I don't have access to dynamic methods like liked_.

Any idea how to manage that would be welcome!

Thanks

@davidcelis
Owner

So the solution for this will end up being to use recommends 'forem/posts', but I'm gonna have to do a bit of finagling to get the dynamic methods working. I'll take a stab at it soon and hopefully have something working this weekend

@davidcelis
Owner

So, gotta be honest, I'm not really sure what to do about the dynamic finders in this case. / isn't a character that can be used in method names, so something like liked_forem_posts is the only possibility. However, there's no good way to distinguish between the cases of Forem::Post and ForemPost in that case. I could remove the privacy from liked_for so that you can at least do liked_for(Forem::Post)... But I don't think there's anything to be done about the dynamic finders.

@jbfeldis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.