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 8217895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:36:06+00:00 2026-06-07T12:36:06+00:00

There is a canceled column in table record in our rails 3.1.4 app. Initially

  • 0

There is a canceled column in table record in our rails 3.1.4 app. Initially the canceled was created in Firefox SQLite manager as BOOL which is a default type provided by the software. With canceled = false in rails, the false was saved into the record table for col canceled. The problem is when query with Record.where("canceled = ?", false), the records with canceled as false were not selected because false is not interpreted as FALSE in sqlite3. In order to select all canceled = false, we have to do Record.where("canceled =? OR canceled =?", false, 'false').

After we manually changed the data type of canceled from BOOL to ‘boolean’ in SQLite manager, the Record.where("canceled =? ", false) can pick up the newly created record with canceled as f. In SQLite manager, those canceled value is represented as f which is interpreted as FALSE by rails.

How to fix the table record (with ‘false’ for canceled) so that Record.where("canceled =? ", false) will work? Thanks so much.

UPDATE: when query the table record in rails console, the canceled does not behave as a boolean (either true or false). All records with false in column canceled can not be picked up by either Record.where("canceled =?", true) or Record.where("canceled =?", false). But the .class returned for canceled is still FalseClass in rails console. Strange, isn’t it?

  • 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-07T12:36:08+00:00Added an answer on June 7, 2026 at 12:36 pm
    UPDATE my_table
       SET canceled = true -- or 1 check the table
     WHERE canceled = 'true'
    
    
    UPDATE my_table
       SET canceled = false
     WHERE canceled = 'false'
    

    Edit:

    Try this

    my_model.update_all( {:canceled => true}, {:canceled => 'true'} )
    my_model.update_all( {:canceled => false}, {:canceled => 'false'} )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a column that exists in 2 tables. In table 1, this column
There's a Rails 3.2.3 web application which doesn't use any database. But in spite
I am running the following migrations in my Rails app on a table that
There is a moment in my app, that I need to force to show
There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
There are two table s : one is the master and one the detail
I'm in the process of adding Devise to an existing Rails app, with a
I have a table which looks something like Event ID Date Instructor 1 1/1/2000
I created a JOINABLE thread and later canceled it near the end of the

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.