Thursday, July 1, 2010

Re: save() omitted

It is solved. When I created my table I defined outcome as tinyint and when baked, cake made a validation rule to be boolean. I then realized I need at least 3 values for that field and changed it to float. When trying to update the record with -1 the validation rule was broken and no update was performed. It's all fixed now. Thanks.


On Thu, Jul 1, 2010 at 8:29 PM, Edinei L. Cipriani <phpedinei@gmail.com> wrote:
try to do an insert with the data you are testing directly into your database, so I noticed you need the user_id and stage_id


2010/7/1 Andrei Mita <andrei.mita@gmail.com>

The action is the above one and the model(with validation rules deleted):

<?php
class Game extends AppModel {
    var $name = 'Game';

    var $belongsTo = array(
        'Stage' => array(
            'className' => 'Stage',
            'foreignKey' => 'stage_id',
        ),
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'user_id',
        )
    );

    var $hasMany = array(
        'Answer' => array(
            'className' => 'Answer',
            'foreignKey' => 'game_id',
            'dependent' => false,
        )
    );

}
?>


On Thu, Jul 1, 2010 at 8:04 PM, Edinei L. Cipriani <phpedinei@gmail.com> wrote:
Em 01/07/10 13:57, Andrei Mita escreveu:

I am unbelievably stupid some times. I have lost two days trying to figure this one out and it never crossed my mind to check the validation rules in the model. And everything was right there in the manual: "If for some reason your data isn't saving, be sure to check to see if some validation rules aren't being broken."
Please, paste your action and your model, for me.


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en



--
Edinei L. Cipriani
Blog: http://phpedinei.wordpress.com
Twitter: http://www.twitter.com/phpedinei

Desenvolvedor Colégio Trilingue Inovação
Site: http://www.colegioinovacao.com.br
Fone 49 84149086

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: