Changeset 312
- Timestamp:
- 08/18/07 10:26:22 (1 year ago)
- Files:
-
- trunk/lib/Ak.php (modified) (1 diff)
- trunk/lib/AkActiveRecord.php (modified) (1 diff)
- trunk/lib/AkInstaller.php (modified) (1 diff)
- trunk/test/unit/lib/AkActiveRecord/_AkActiveRecord_type_casting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/Ak.php
r308 r312 1026 1026 if(is_array($element)){ 1027 1027 return count($element); 1028 }elseif (is_numeric($element) && !is_string($element)){ 1029 return $element; 1028 1030 }elseif (is_string($element)){ 1029 1031 return strlen($element); 1030 }elseif (is_numeric($element)){1031 return $element;1032 1032 }elseif (is_object($element) && method_exists($element,'size')){ 1033 1033 return $element->size(); trunk/lib/AkActiveRecord.php
r299 r312 4828 4828 { 4829 4829 if(!AK_ENABLE_AKELOS_ARGS){ 4830 $this->_castDateParametersFromDateHelper_($args); 4830 4831 return ; 4831 4832 } trunk/lib/AkInstaller.php
r311 r312 244 244 245 245 if(in_array($table_name, $created_tables)){ 246 return false;246 //return false; 247 247 } 248 248 if($this->tableExists($table_name)){ trunk/test/unit/lib/AkActiveRecord/_AkActiveRecord_type_casting.php
r295 r312 10 10 function test_start() 11 11 { 12 $this->installAndIncludeModels(array('Tag' ));12 $this->installAndIncludeModels(array('Tag','Post')); 13 13 } 14 14 … … 19 19 $this->assertTrue($Tag->save()); 20 20 $this->assertEqual($Tag->get('score'), 100); 21 21 22 22 $Tag->setAttributes(array('score' => '0')); 23 23 $this->assertTrue($Tag->save()); 24 24 25 25 $Tag =& $Tag->find($Tag->id); 26 26 $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 28 45 } 29 46 }
