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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:14:56+00:00 2026-05-26T13:14:56+00:00

We have a boolean field in our system (using Rails 3.0.4) and when attached

  • 0

We have a boolean field in our system (using Rails 3.0.4) and when attached to MySQL the fields report true and false as appropriate. When attached to Oracle (production) it is returning Fixnum. The column is of type NUMBER(1). Other models correctly return true and false. The controller is doing a simple find. This only happens on the show action. Index returns true false. This happens for both HTML and XML responses. When asking for the type of a field the Console reports a class of FalseClass or TrueClass. The View reports Fixnum.

What could possibly be going wrong?

Updated: Code

create_table "people", :force => true do |t|
  t.string   "name"
  t.boolean  "has_information"
end

class Person < ActiveRecord::Base
  has_many :groups
end

Updated with a clearer question

The Rails convention is to make the field a NUMBER(1) type column. Then converts it to a boolean in the model. This is working in several models in our application. Only ONE model is having this issue. And it only has the issue on the show action. The show action was created by scaffold so is very generic. Why would it Rails not follow convention in this one instance?

Updated with solution

It was fixed in this instance by calling Person.find_by_id!(params[:id]) instead of Person.find(params[:id]) Why the default was returning the wrong class for a field in a normal find is beyond me.

  • 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-26T13:14:57+00:00Added an answer on May 26, 2026 at 1:14 pm

    The answer, update the Oracle Adapter because it is out of date. Version 1.3.0 of the activerecord-oracle_enhanced-adapter gem has a bug that was reported:

    https://github.com/rsim/oracle-enhanced/issues/7

    We updated the driver and everything works as expected now.

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

Sidebar

Related Questions

We have this field in our database indicating a true/false flag for each day
If I have a boolean field like: private static final boolean DEBUG = false;
I have an Oracle database and the boolean fields are CHAR(1) with Y/N stored.
I want to stop threads by using a boolean field. I have implemented some
Have a boolean field (using formtastic) and the value won't persist through an error.
I have a boolean (BOOL) type field in the SQLite table. In the SubSonic
I have a class that contains a boolean field like this one: public class
I have a strange problem which I can't fix: A field: private boolean[][][] gaps;
I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but
I have an EntityFramework model which has a boolean field. To make the mapping

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.