<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -16,36 +16,38 @@ class Fixtures{
     const YAML_FILE_IS_INVALID  = -2;
     const YAML_FILE_NOT_LOADED  = -3;
     const TABLE_NOT_FOUND       = -4;
-    
+
     var $sPrefix = '';
-        
+    var $oDb;
+
     /**
     * Constructor - checks dependencies and loads the connection
     *
     * @param string $sConnecion The connection from database.php to use. Deafaults to &quot;default&quot;
     * @return void
     */
-    function Fixtures(){
+    function Fixtures($sConnection = 'default'){
         if(class_exists('Spyc'))
             $this-&gt;bSpycReady = true;
+        $this-&gt;oDb = &amp; ConnectionManager::getDataSource($sConnection);
     }
-    
+
     function import($sFile){
         if( !$this-&gt;bSpycReady )
             return self::SPYC_CLASS_NOT_FOUND;
-        
+
         if( !file_exists( $sFile ) )
             return self::YAML_FILE_NOT_FOUND;
 
         $this-&gt;aTables = SPYC::YAMLload( file_get_contents( $sFile ) );
         if( !is_array( $this-&gt;aTables ) )
             return self::YAML_FILE_IS_INVALID;
-        
+
         uses('model'.DS.'model');
-        
-        $oDB = &amp;ConnectionManager::getDataSource('default');
+
+        $oDB = $this-&gt;oDb;
         $aAllowedTables = $oDB-&gt;listSources();
-        
+
         foreach( $this-&gt;aTables as $table =&gt; $records ){
             if( !in_array( $oDB-&gt;config['prefix'].$table, $aAllowedTables ) ){
                 return self::TABLE_NOT_FOUND;</diff>
      <filename>fixtures/fixtures.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>802ab6c174d0077fbc4878ad1c464f04fc4b3a7d</id>
    </parent>
  </parents>
  <author>
    <name>Georgi Momchilov</name>
    <email>georgi@ovalpixels.com</email>
  </author>
  <url>http://github.com/georgious/cakephp-yaml-migrations-and-fixtures/commit/260209ede6f09f12a78cfc71e8bea3d703672495</url>
  <id>260209ede6f09f12a78cfc71e8bea3d703672495</id>
  <committed-date>2008-11-16T06:34:05-08:00</committed-date>
  <authored-date>2008-11-16T06:34:05-08:00</authored-date>
  <message>added ability to change fixtures DataSource</message>
  <tree>4c17c4c7a531905dd1f4584c59020446768c2172</tree>
  <committer>
    <name>Georgi Momchilov</name>
    <email>georgi@ovalpixels.com</email>
  </committer>
</commit>
