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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:41:17+00:00 2026-05-16T08:41:17+00:00

I have a DB field that is integer type and values are always 0

  • 0

I have a DB field that is integer type and values are always 0 or 1. How do I grab the equivalent boolean value in ruby? such that when i do the following the check box is set appropriately:

<%= check_box_tag 'resend', @system_config.resend %>
  • 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-16T08:41:18+00:00Added an answer on May 16, 2026 at 8:41 am

    You could use the zero? method. It returns true if 0. If you need to backwards, you could easily negate it to !@system_config.resend.zero?. Or you could extend the Fixnum class, adding a to_b? method, since everything is open and extensible in dynamic languages.

    class Integer
      def to_b?
        !self.zero?
      end
    end
    

    alt text

    Ruby API: http://ruby-doc.org/core/classes/Fixnum.html#M001050

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

Sidebar

Ask A Question

Stats

  • Questions 508k
  • Answers 508k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Those links are built up from the different layout XML… May 16, 2026 at 4:14 pm
  • Editorial Team
    Editorial Team added an answer You need 3 table Users Questions Votes Having Votes a… May 16, 2026 at 4:14 pm
  • Editorial Team
    Editorial Team added an answer To get started we'd need the version you are on… May 16, 2026 at 4:14 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have 7 8-bit integer values per record that I want to store in
I have a table with a nullable integer field that is a foreign key.
I have the following definition for an id field in an entity that is
At the company I work for date and time values have always been stored
I have the following structures defined (names are anonymised, but data types are correct):
I have a MySQL database that is exhibiting behavior I would like to understand
I have a small problem here and hope that someone can help me out.
I want to JOIN two table. Have no problem with that. I have problem
Somewhat academic question, but: How do value types like Int actually work ? I've
Ok, so what I wan´t to do is to perform a SPSiteDataQuery that gives

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.