Skip to content

Query#update doesn't allow *not* updating the updated_at field #1155

Description

@asuntskel

Right now, batch Query#update, always changes updated_at.

I totally understand the reason why it was added (#1087 and #1091), but I also think it would be useful to have an option to opt-in / out.

Since at first I thought doing column: IGNORE would do something like this (wrong), I was thinking of a solution such as

Query.update(column: value, updated_at: UNCHANGED) # so you can specifically opt-out of auto updating
# or something like...
Query.update_only(column: value) # only available on tables that have have the timestamps

That would be useful for system-wide tasks / admin stuff and batch updating models with a lot of columns.
I wonder what anyone else thinks of this? Let me know :)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions