Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:fuel/orm into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelmer Schreuder committed Jul 23, 2011
2 parents 0554300 + 9fb2caf commit d345de4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/observer/updatedat.php
Expand Up @@ -19,7 +19,10 @@ class Observer_UpdatedAt extends Observer {

public function before_save(Model $obj)
{
$obj->{static::$property} = static::$mysql_timestamp ? \Date::time()->format('mysql') : \Date::time()->get_timestamp();
if ($obj->is_new() or $obj->is_changed())
{
$obj->{static::$property} = static::$mysql_timestamp ? \Date::time()->format('mysql') : \Date::time()->get_timestamp();
}
}
}

Expand Down

0 comments on commit d345de4

Please sign in to comment.