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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:30:28+00:00 2026-06-11T22:30:28+00:00

In my application I have a model that is below; class Init < ActiveRecord::Base

  • 0

In my application I have a model that is below;

class Init < ActiveRecord::Base
  attr_accessor :clientAvailability
  attr_accessible :returnCode, :returnMessage, :tokenCode, :updateURL
end

In here when I’ve added the **attr_accessor** later on and when I try to apply **render json: init** it doesn’t show the **clientAvailability** property even though I’ve set it as;

init=Init.new
init.clientAvailability="3"

When I debug it I can see that it is set, but doesn’t simply show up when I try to render it as json. What could be the thing I’m missing?

  • 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-11T22:30:29+00:00Added an answer on June 11, 2026 at 10:30 pm

    Is clientAvailability a column in the DB? If not, then I suppose it is the default way – to serialize only the DB attributes. But you can do:

    render json: init, methods: [:clientAvailability]
    

    to include clientAvailability attribute.

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

Sidebar

Related Questions

In a client application I have a DBIx::Class model 'Todo' that can be linked
I have one grails application.In that I have one model class named Book. From
I am building an application that will have a model that belongs_to another model
In my application I have a custom model binder that I set to the
In my Yii application, I have a model that represents siteconfig table and have
I have a model function that updates a user in my CodeIgniter application: //
I have an MVC application. The model has a property that is a struct
I have a Model called blog_model. The code for its constructor is below: class
Below is the code that I have in my rails application. I can't figure
I have an application that uses Core Data. I have two data models 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.