ruby on rails - Check if voted for scope - acts as votable -


the acts_as_votable gem allows check if user voted votable model. https://github.com/ryanto/acts_as_votable

user.voted_on?(@votable)

the gem allows cast votes using scope

user.vote(@votable), vote_scope: 'funny' user.vote(@votable), vote_scope: 'useful'

i wondering how check if user voted on object, in specific scope.

i imagine code like

user.voted_on? @votable, vote_scope: 'funny'

is possible gem?

yes, example syntax correct:

user.voted_on? @votable, vote_scope: 'funny' 

the voted_on? , voted_for? methods accept :vote_scope option.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -