Skip to content

Commit

Permalink
Merge pull request #3 from sizuhiko/develop
Browse files Browse the repository at this point in the history
bug fixes
  • Loading branch information
sizuhiko committed Feb 11, 2014
2 parents 386764a + d05bcdc commit 9474438
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lib/Fabricate.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function create($modelName, $recordCount=1, $callback = null) {
$model = ClassRegistry::init($modelName);
foreach ($attributes as $data) {
$model->create($data);
$model->save();
$model->save(null, self::getInstance()->config->auto_validate);
}
}
/**
Expand Down
1 change: 1 addition & 0 deletions Lib/FabricateConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
*/
class FabricateConfig {
public $sequence_start = 1;
public $auto_validate = false;
}
2 changes: 1 addition & 1 deletion Lib/FabricateContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function sequence($name, $start=null, $callback=null) {
$start = null;
}
if(!array_key_exists($name, $this->sequences)) {
if($start == null) {
if($start === null) {
$start = $this->config->sequence_start;
}
$this->sequences[$name] = new FabricateSequence($start);
Expand Down

0 comments on commit 9474438

Please sign in to comment.