Package models

Examples of models.Rate


        }
        else
        {
            List<ModuleVersion> moduleVersions = ModuleVersion.findByModule(module);
            User user = currentUser();
            Rate rate = null;
            Vote vote = null;

            if (user != null)
            {
                rate = CollectionUtils.filterFirst(user.rates,
View Full Code Here


                result = badRequest("Module does not exist");
            }
            else
            {
                User user = currentUser();
                Rate rate = null;

                if (user != null)
                {
                    // user shouldn't be null because of @RoleHolderPresent
                    rate = CollectionUtils.filterFirst(user.rates,
                                                       new Filter<Rate>()
                                                       {
                                                           @Override
                                                           public boolean isAcceptable(Rate rate)
                                                           {
                                                               return rate.playModule.id.equals(module.id);
                                                           }
                                                       });
                    if (rate != null)
                    {
                        module.rating.subtract(rate);
                    }
                    else
                    {
                        rate = new Rate();
                        rate.playModule = module;
                        user.rates.add(rate);
                    }
                    rate.rating = ratingForm.rating;
                    module.rating.add(rate);
View Full Code Here

TOP

Related Classes of models.Rate

Copyright © 2018 www.massapicom. 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.