Package models

Examples of models.Module.save()


                    }
                    rate.rating = ratingForm.rating;
                    module.rating.add(rate);
                    module.rating.calculateAverage();

                    module.save();
                    user.save();
                }

                RatingResponseForm responseForm = new RatingResponseForm();
                responseForm.totalRatings = module.rating.totalRatings();
View Full Code Here


        else
        {
            Module module = form.get();
            module.owner = user;
            module.rating = new Rating(true);
            module.save();

            createHistoricalEvent("New module - " + module.name,
                                  String.format("%s (%s) created a new module - %s",
                                                user.displayName,
                                                user.userName,
View Full Code Here

                {
                    --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",
                                              user.userName,
View Full Code Here

                vote.publicVote = false;
                user.votes.add(vote);
                user.save();

                ++module.upVoteCount;
                module.save();
            }

            VoteResponseForm responseForm = new VoteResponseForm();
            responseForm.upVotes = module.upVoteCount;
            responseForm.downVotes = module.downVoteCount;
View Full Code Here

                {
                    --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",
                                              user.userName,
View Full Code Here

                vote.publicVote = false;
                user.votes.add(vote);
                user.save();

                ++module.downVoteCount;
                module.save();
            }

            VoteResponseForm responseForm = new VoteResponseForm();
            responseForm.upVotes = module.upVoteCount;
            responseForm.downVotes = module.downVoteCount;
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.