Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7556219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:48:39+00:00 2026-05-30T11:48:39+00:00

If you model contains a filed which are called created and updated When you

  • 0

If you model contains a filed which are called “created” and “updated”

When you use PUT to update content to this record..

  1. Should created be set to the time of data creation or modification? Since PUT is idempotent, so it should not rely on previous value

  2. Since updated is always modified when you issue the request, so it violated the principle of idempotent?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:48:41+00:00Added an answer on May 30, 2026 at 11:48 am

    Should created be set to the time of data creation or modification? Since PUT is idempotent, so it should not rely on previous value.

    I don’t really understand what you’re asking here. There’s no reason created_at would be set to the modification time, since they are two distinct concepts.

    Since updated is always modified when you issue the request, so it violated the principle of idempotent?

    Your assumption that updated_at is always modified isn’t true (at least not in Rails, nor should it be anywhere else). If you do an identical PUT multiple times, idempotence is not violated since these subsequent requests don’t modify any of the attributes, and thus the updated_at time is not changed.

    There is an interesting post on the Rails blog about PUT & PATCH that adds a lot more to this. The way I see it, the user should never send created_at or updated_at with their request (since the server should probably usually ignore them and set them itself), though it is indeed questionable if this violates the idea that a PUT should send the entire object. However, if that idea is ignored (as it often is in Rails, and perhaps elsewhere), then PUT is indeed idempotent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model category which contains a field called category.parent_id which is used
I have a Model called statistics which has a value field that contains Goals
My model contains a string field called longdescription which gets the value of the
I've got a user model which contains a field called, lets say, text1. In
I have a Product Model, which contains a foreign key to a ProductCategory record,
i have an entity-model file (edmx) file which contains few tables and few stored
For instance, Model Resume contains variable number of Model Project 's, What should be
I have a model form that contains a DecimalField() with max_digits set to 5.
I use custom model binder to bind Order/OrderItem in my actions. This model binder
My Core Data model contains an entity, Shape, that has two self-referential relationships, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.