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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:31:09+00:00 2026-05-19T02:31:09+00:00

What is the convention for naming a has_many through table/model if I have a

  • 0

What is the convention for naming a has_many through table/model if I have a model called events and one called users?

Is it events_users for the table? If so I get a problem with naming the Model, because rails doesn’t seem to like EventUser, nor does it seem to like EventsUser…

  • 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-19T02:31:10+00:00Added an answer on May 19, 2026 at 2:31 am

    There are many ways to do this. Try naming your table events_users. By default, the two involved tables in a has_many through or a has_and_belongs_to_many are pluralized and ordered alphabetically.

    You only need a model for the association if you plan on using it. If so, name it logically, and tell ActiveRecord the table name is events_users.

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

Sidebar

Related Questions

Is there a convention for naming the private method that I have called _Add
Is there a convention for naming private functions in bash? I have a bash
Im working on a legacy oracle database with a slightly odd table naming convention
You can have different naming convention for class members, static objects, global objects, and
I have a naming convention on a bunch of files that I'd like to
Has anybody established a good naming convention for action in MVC? I was specifically
I am building a CMS and the naming convention for classes has been debated
The naming convention for constants in C# is Pascal casing: private const int TheAnswer
In my naming convention, I use _name for private member variables. I noticed that
what is the naming convention for message bundle property files when using variants? for

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.