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

Make it possible to disable some but not all timestamp columns #1334

Merged
merged 3 commits into from Feb 4, 2014

Conversation

3 participants
@janmeier
Member

janmeier commented Feb 2, 2014

Closes #1175

@@ -173,6 +173,11 @@ module.exports = (function() {
updatedAt: Utils._.underscoredIf(this.options.updatedAt, this.options.underscored),
deletedAt: Utils._.underscoredIf(this.options.deletedAt, this.options.underscored)
}
Utils._.each(this.DAO.prototype._timestampAttributes, function (key, val) {

This comment has been minimized.

@janmeier

janmeier Feb 2, 2014

Member

Is there a more idiomatic way to filter objects by value?

@@ -237,14 +239,14 @@ module.exports = (function() {
value.forEach(function(data) {
var daoInstance = include.daoFactory.build(data, {
isNewRecord: false,

This comment has been minimized.

@janmeier

janmeier Feb 2, 2014

Member

Unrelated formatting to please jshint

@gustavpursche

This comment has been minimized.

gustavpursche commented on lib/dao-factory.js in 661dd1c Feb 2, 2014

upps.

This comment has been minimized.

Owner

janmeier replied Feb 3, 2014

Yup, went too far back in my console history when i wanted to rerun the tests, and accidentally committed while i was in the middle of refactoring :)

@janmeier

This comment has been minimized.

Member

janmeier commented Feb 2, 2014

WIP based on comments from mickhansen. Last commit was made accidentally mid refactoring so it probably doesn't make much sense. Will have something working in a couple of days

@mickhansen

This comment has been minimized.

Contributor

mickhansen commented Feb 2, 2014

@janmeier perhaps instead of this.DAO.prototype._timestampAttributes we could just attach it on the model, and then just reference this.Model._timestampAttributes - Probably a bit cleaner to reason about.

change timestampattributes to be on the model instead of instance.pro…
…totype. Removed touchedAt, since it wasn't used anywhere, or part of any schema

@janmeier janmeier referenced this pull request Feb 4, 2014

Merged

Docs for timestamp options #128

@mickhansen

This comment has been minimized.

Contributor

mickhansen commented Feb 4, 2014

Solid great work @janmeier <3

@mickhansen mickhansen closed this Feb 4, 2014

@mickhansen mickhansen reopened this Feb 4, 2014

mickhansen added a commit that referenced this pull request Feb 4, 2014

Merge pull request #1334 from janmeier/disableIndividualTimestamps
Make it possible to disable some but not all timestamp columns

@mickhansen mickhansen merged commit afd32fc into sequelize:master Feb 4, 2014

1 check passed

default The Travis CI build passed
Details

@janmeier janmeier deleted the janmeier:disableIndividualTimestamps branch Feb 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment