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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:33:42+00:00 2026-05-14T04:33:42+00:00

My app has normal users: those which come through a typical signup page facebook(FB)

  • 0

My app has

  • “normal” users: those which come through a typical signup page
  • facebook(FB) users: those which come from Facebook connect
  • “FB-normal” users: a user that can log with both email/password * FB connect

Further, there’s the a slew of other openID-ish login methods (I don’t think openID itself will be acceptable since it doesn’t link up the accounts and allow the 3rd party specific features (posting to twitter, adding a FB post, etc etc))

So, how do I model this?

Right now we have User class with #facebook_user? defined — but it gets messy with the “FB-normal” users – plus all the validations become very tricky and hard to interpret. Also, there are methods like #deliver_password_reset! which make no sense in the context for facebook-only users. (this is lame)

I’ve thought out STI (User::Facebook, User::Normal, User::FBNormal, etc.) This makes validations super slick, but it doesn’t scale to other connection types, and all the permutations between them… User::FacebookLinkedInNormal(wtf?) Doing this with a bunch of modules I think would suck a lot.

Any other ideas?

  • 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-14T04:33:43+00:00Added an answer on May 14, 2026 at 4:33 am

    I would split up the concerns, seems like it doesn’t make sense to keep records that have vastly different fields in one table.

    Just have one User model/table that doesn’t save any credentials, and make that have a has_many relationship to an Account/Login Method, where you could use STI to model the different types.

    class User < AR::B
      has_many :accounts
    end
    
    class Account < AR::B;end
    
    class PasswordAccount < Account;end 
    
    class GoogleAccount < Account;end
    
    class FacebookAccount < Account;end
    
    …
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app has a simple signup where the user types in his/her email address
I've got a page on my Python app which has a drop-down box of
My app has an options menu that is available in almost all Activities, which
My app has an expensive service method, results of which must be 1) checked
My app has a function where it takes user input and then calls HttpGet
I am building a web app which users use to assign tasks to each
We have a web app that has a built-in search feature that our users
Users can be edited from a normal resourceful URI like: /users/1/edit The issue is
I'm writing an app which main purpose is to keep list of users purchases.
I have an app with several 'normal' activities which can run on either landscape

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.