Changeset 312

Show
Ignore:
Timestamp:
08/18/07 10:26:22 (1 year ago)
Author:
bermiferrer
Message:

Commit [308] introduced some bugs undetected by the unit tests which have been on this ticket.

Fixed tickets are #31 and #36. Some other issues reported in the forum might also be related to this fixed bug.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/Ak.php

    r308 r312  
    10261026        if(is_array($element)){ 
    10271027            return count($element); 
     1028        }elseif (is_numeric($element) && !is_string($element)){ 
     1029            return $element; 
    10281030        }elseif (is_string($element)){ 
    10291031            return strlen($element); 
    1030         }elseif (is_numeric($element)){ 
    1031             return $element; 
    10321032        }elseif (is_object($element) && method_exists($element,'size')){ 
    10331033            return $element->size(); 
  • trunk/lib/AkActiveRecord.php

    r299 r312  
    48284828    { 
    48294829        if(!AK_ENABLE_AKELOS_ARGS){ 
     4830            $this->_castDateParametersFromDateHelper_($args); 
    48304831            return ; 
    48314832        } 
  • trunk/lib/AkInstaller.php

    r311 r312  
    244244         
    245245        if(in_array($table_name, $created_tables)){ 
    246             return false; 
     246            //return false; 
    247247        } 
    248248        if($this->tableExists($table_name)){ 
  • trunk/test/unit/lib/AkActiveRecord/_AkActiveRecord_type_casting.php

    r295 r312  
    1010    function test_start() 
    1111    { 
    12         $this->installAndIncludeModels(array('Tag')); 
     12        $this->installAndIncludeModels(array('Tag','Post')); 
    1313    } 
    1414 
     
    1919        $this->assertTrue($Tag->save()); 
    2020        $this->assertEqual($Tag->get('score'), 100); 
    21          
     21 
    2222        $Tag->setAttributes(array('score' => '0')); 
    2323        $this->assertTrue($Tag->save()); 
    24          
     24 
    2525        $Tag =& $Tag->find($Tag->id); 
    2626        $this->assertIdentical($Tag->get('score'), 0); 
    27          
     27 
     28    } 
     29 
     30    // Ticket #36 
     31    function test_should_update_dates_correctly() 
     32    { 
     33        $params = array( 
     34        'title' => 'Hello', 
     35        'body' => 'Hello world!', 
     36        'posted_on(1i)' => '2005', 
     37        'posted_on(2i)' => '6', 
     38        'posted_on(3i)' => '16'); 
     39        $Post =& new Post(); 
     40        $Post->setAttributes($params); 
     41        $this->assertTrue($Post->save()); 
     42        $Post->reload(); 
     43        $this->assertEqual($Post->get('posted_on'), '2005-06-16'); 
     44 
    2845    } 
    2946}