acts_as_votable icon indicating copy to clipboard operation
acts_as_votable copied to clipboard

Scoping for `for_type` method

Open hapiben opened this issue 10 years ago • 1 comments

Hi, is there a way where I can use the snippet below and specify the vote_scope as well?

@user.votes.up.for_type(Post).votables

Thanks.

hapiben avatar Sep 06 '14 09:09 hapiben

@benedictaluan according to the README, there's a to-do for that:

Smarter language syntax. Example: @user.likes will return all of the votables that the user likes, while @user.likes @model will cast a vote for @model by @user.

In your case, it would be @user.likes Post, but of course, it's a to-do, so it haven't been implemented yet. A PR would be nice :)

bmfreitas avatar Nov 13 '14 00:11 bmfreitas