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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:10:10+00:00 2026-06-15T20:10:10+00:00

I have two classes, PSA and ZIP and the are related by PSAZIP by

  • 0

I have two classes, PSA and ZIP and the are related by PSAZIP by has_many: & :through.

I am having errors thrown with the following in each class:

psa.rb (genereated by rails g scaffold PSA)

class Psa < ActiveRecord::Base
  has_many :psazips
  has_many :zips, :through => psazips
end

psazip.rb (genereated by rails g scaffold PSAZIP)

class Psazip < ActiveRecord::Base
  belongs_to :psa
  belongs_to :zip
end

zip.rb (genereated by rails g scaffold ZIP)

class Zip < ActiveRecord::Base
  has_many:psazips
  has_many:psas, :through => :psazips
end

What is the syntax and case grammar for when both Classes are entirely Uppercase? When I have two other class relationships (PSA and State, the rb file name is psa_state.rb).

Do I have to rename the psazip.rb to psa_zip.rb? if so, where else do I need to make the change?

  • 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-15T20:10:11+00:00Added an answer on June 15, 2026 at 8:10 pm

    What you have should work as is.

    Rails will convert any class name written in camel case to lowercase/underscore form for file names. It thinks PSAZIP is just one word. It doesn’t see it as camel case, so it generates psazip instead of psa_zip. Had you used PsaZip or PSAZip, it would have generated psa_zip.

    But, everything should work as you have it, so long as you consistenly use the class name Psazip.

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

Sidebar

Related Questions

I have two classes which depend on each other. I've solved this problem before
I have two classes: Parent and Child with Child: belongs_to :parent and Parent has_many
I have two classes: A and B. Each A has an ordered ranking of
I have two classes that each implement an interface. One of the classes contains
I have two classes, each in a different packages and there is a one-to-many
I have two classes, A & B. B is inheriting from A, I want
I have two classes, Foo and Bar. Each Foo has a name and a
I have two classes (MVC view model) which inherits from one abstract base class.
I have two classes A and B generated by cxf-codegen-plugin from my WSDL. A
I have two classes Foo and Bar . The tables in the database look

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.