-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.5] Allow to disable CREATED_AT #22990
Conversation
This is too risky, please re-submit with tests. |
I thought this was already possible with overriding this in your model (or am I wrong?): public function getCreatedAtColumn()
{
return null;
} |
@mfn no its not possible, since
Thats why there is additional verification required in updateTimestamps method: if (! is_null(static::CREATED_AT) && ! $this->exists && ! $this->isDirty(static::CREATED_AT)) {
$this->setCreatedAt($time);
} |
Wouldn't it be enough to set |
@36864 if it was so easy I wouldn't created a pull request =) |
I'll try to extend this PR with the tests as @tillkruss requested. I'm trying to make the framework consistent, if we allowed to use |
I don't understand this. If you don't want to use |
@ludo237 yes, absolutely. In my case I want to keep model using |
You could hook up the Also an additional column is not that much of a big deal to be honest. Donald Knuth once said:
|
Exactly as we allowed to disable UPDATED_AT b4758e2
I'm allowing to disable CREATED_AT by setting
const CREATED_AT = false;
in the model