Package models

Examples of models.Vote.save()


                if (vote.voteType == Vote.VoteType.DOWN)
                {
                    --module.downVoteCount;
                    ++module.upVoteCount;
                    vote.voteType = Vote.VoteType.UP;
                    vote.save();
                    module.save();
                }
                else
                {
                    Logger.info(String.format("User [%s] tried to upvote module [%s] but vote already existed",
View Full Code Here


                if (vote.voteType == Vote.VoteType.UP)
                {
                    --module.upVoteCount;
                    ++module.downVoteCount;
                    vote.voteType = Vote.VoteType.DOWN;
                    vote.save();
                    module.save();
                }
                else
                {
                    Logger.info(String.format("User [%s] tried to downvote module [%s] but vote already existed",
View Full Code Here

                if (vote != null) {
                    vote.value = !value;
                } else {
                    vote = new Vote(talk, member, !value);
                }
                vote.save();
                return Vote.findNumberOfVotesBySession(talk);
            }
        }
        return -1;
    }
View Full Code Here

        assertEquals(0, Activity.count("session = ?", lt));
        assertNull(Activity.find("session = ?", lt).first());
       
        // Positive vote
        v.value = true;
        v.save();
       
        // One activity for the session
        assertEquals(1, Activity.count("session = ?", lt));
        Activity a = Activity.find("session = ?", lt).first();
        assertActivity(a);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.