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

  • Home
  • SEARCH
  • 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 8880185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:07:13+00:00 2026-06-14T20:07:13+00:00

A user can assign a field due_time_at which has the TIME datatype in the

  • 0

A user can assign a field due_time_at which has the TIME datatype in the database. After they update with a time they might change there mind and not want a specific time. Currently when the user tries to set the time back to NULL it just sets the field to 00:00 in the DB. Is there any way to get this back to nil?

I was able to get the desired result by forcing "" to all the attributes in the post. I looks like the fields params[:something][:'due_time_at(1i)'], params[:something][:'due_time_at(2i)'], params[:something][:'due_time_at(3i)'] still had data in them even though you set the time to "". If anybody has a better way let me know.

if params[:something][:'due_time_at(4i)'] == ""
  params[:something][:'due_time_at(1i)'] = ""
  params[:something][:'due_time_at(2i)'] = ""
  params[:something][:'due_time_at(3i)'] = ""
  params[:something][:'due_time_at(4i)'] = ""
  params[:something][:'due_time_at(5i)'] = ""
end 
  • 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-06-14T20:07:14+00:00Added an answer on June 14, 2026 at 8:07 pm

    This should work :

    obj.update_attributes({:due_time_at => nil})
    

    If you are passing the params hash to the update_attribute method, you can check its values and set the :due_time_at value to nil.

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

Sidebar

Related Questions

A user can upload a picture on my site at which point jQuery inserts
I want to use two exceptions. the first: The user can say (every time,
If a user places HTML in a textarea field, how can I check if
I have a simple, dynamic email form field. After the user submits their email,
I have User, which can be one of three types: Admin, Student, Teacher. Everyone
I'm trying to get make method in which I can assign values to multiple
I have a project object. A user can assign a worker object for it.
I have a Firebase with a users reference, which has a field user_id .
I have a function which splits nested attributes into an array so they can
User can switch active application by Alt+Tab or by clicking on their icons in

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.