Package models

Examples of models.Talk.save()


    private Talk createTalk(Member... speakers) {
        Talk t = new Talk();
        for (Member s : speakers) {
            t.addSpeaker(s);
        }
        return t.save();
    }

    private LightningTalk createLT(Member... speakers) {
        LightningTalk lt = new LightningTalk();
        for (Member s : speakers) {
View Full Code Here


   
    private static Talk createTalk(final String title, Member speaker, boolean valid){
        Talk t = new Talk();
        t.title = title;
        t.addSpeaker(speaker);
        t.save();
        if (valid) {
            t.validate();
        }
        return t;
    }
View Full Code Here

    @Test
    public void addCommentValid() {
        Talk t = createTalk("test");
        // Ensure the talk is valid
        t.valid = true;
        t.save();
       
        // Non activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        SessionComment c = new SessionComment(member, t, "Un commentaire");
View Full Code Here

        // Non activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        SessionComment c = new SessionComment(member, t, "Un commentaire");
        t.addComment(c);
        t.save();
       
        // One activity for the session
        assertEquals(1, Activity.count("session = ?", t));
        Activity a = Activity.find("session = ?", t).first();
        assertActivity(a);
View Full Code Here

    @Test
    public void addCommentNonValid() {
        Talk t = createTalk("test");
        // Ensure the talk is unvalid
        t.valid = false;
        t.save();
       
        // Non activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        SessionComment c = new SessionComment(member, t, "Un commentaire");
View Full Code Here

        // Non activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        SessionComment c = new SessionComment(member, t, "Un commentaire");
        t.addComment(c);
        t.save();
       
        // Still no activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        t.validate();
View Full Code Here

    }

    protected Talk createTalk(String title) {
        Talk t = new Talk();
        t.title = title;
        return t.save();
    }

    protected LightningTalk createLightningTalk(String title) {
        LightningTalk lt = new LightningTalk();
        lt.title = title;
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.