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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:50:24+00:00 2026-06-04T20:50:24+00:00

I am making a Ruby on Rails app and am realizing that my User

  • 0

I am making a Ruby on Rails app and am realizing that my User class could potentially end up with a lot of generic boolean / integer attributes. For example, suppose I have a promotion each quarter, and I only want a person to be able to use the promotion once. Then I’d have to make a new column each quarter has_used_promotion_N to track that promotion.

Alternatively, I’m thinking of creating a new column called “Generic Flags” which is just a comma separated value of flags set on the account. For example:

“has_used_promotion_1, has_used_promotion_2, limit_on_feature_a=20” etc. could be set for some particular user

(or maybe I’ll store it as JSON)

In any case, I’m thinking of giving myself some sort of NoSQL-like functionality in my DB.

Is this really bad design for some reason? Has anyone else done this before? Anything I’m completely missing about RoR?

  • 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-04T20:50:26+00:00Added an answer on June 4, 2026 at 8:50 pm

    In my opinion Promotion should be a separate model with a many to many relationship with User. When you have a promotion you would create a Promotion instance and when a person uses that promotion you add that person to promotion.users relationship.

    This is much better than your idea because you can now query those relationship. Want a list of all users that used the first quarter promotion? No problem. You can do that with your solution, but you have to resort to some hackiness (is that a word?) to do it, and you’d have to parse the generic flag string for EVERY user on EVERY query. Not ideal to say the least.

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

Sidebar

Related Questions

I have a Rails 3rc app on Ruby 1.9.2 that works fine, but Bundler
I'm making a rails app that handles many, many posts. What i want to
I am currently using rails 3.0.7 and ruby 1.9.2 and making a rails App
I am making a Ruby on Rails app and I need to be able
I am making Ruby On Rails 3.0.3 app with JQuery 1.4.4 and jQuery UJS
So I'm making a rails app that also utilizes node.js for realtime features. What
I am making my first app in Ruby on Rails 3.1....Do I have these
I am busy making a ruby on rails app. I want to make an
I'm new to Ruby and Ruby on Rails. I'm making a sample app (not
I am making a Ruby on Rails app and am having trouble setting some

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.