Skip to content

Commit

Permalink
Remove lookup in schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Feb 19, 2017
1 parent de6c28f commit 738115b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/Model/Table/Table.php
Expand Up @@ -69,10 +69,7 @@ public function initialize(array $config) {
}
}

if (
$this->createdField && $this->hasField($this->createdField)
|| $this->modifiedField && $this->hasField($this->modifiedField)
) {
if ($this->createdField || $this->modifiedField && !$this->hasBehavior('Timestamp')) {
$this->addBehavior('Timestamp');
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Model/Table/TableTest.php
Expand Up @@ -381,7 +381,7 @@ public function testRelationShims() {
public function testBehaviorShims() {
$this->Wheels = TableRegistry::get('Wheels');
$behaviors = $this->Wheels->behaviors()->loaded();
$expected = ['Useless'];
$expected = ['Useless', 'Timestamp'];
$this->assertSame($expected, $behaviors);
}

Expand Down

0 comments on commit 738115b

Please sign in to comment.