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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:27:58+00:00 2026-06-17T21:27:58+00:00

I have two models Listing & Building . Both will have an Amenity .

  • 0

I have two models Listing & Building. Both will have an Amenity.

I want to create a polymorphic association between Amenity & the other two models, but I am not quite sure how to name it.

I was thinking of doing has_amenities, but that may be awkward if rails is creating a has_amenities_type column as the reference.

An amenity is like: granite counter top, pool, etc.

How should I approach this?

All the examples I see of polymorphic associations revolved around imageable, commentable, etc.

So not quite sure what to do here. amenitable? That seems…..wrong.

  • 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-17T21:27:59+00:00Added an answer on June 17, 2026 at 9:27 pm

    It’s a bit long winded, but how about can_have_amenities? That’s essentially what imageable / commentable / xxxable are saying, but it doesn’t sound quite so weird as amenitable…

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

Sidebar

Related Questions

I have two models, user and card and i want to establish an association
I have two models, Listing and Invitation, associated with has_and_belongs_to_many. I am looking at
I have two models User and Category that have a HABTM association. I would
I have two models. Deals and Stores. I want to add already created Deals
I have two models, one is Group, the other Item. A group has many
I have two models generated with generate scaffolding, one is a LogBook the other
I have two models called Album and Photo . I want the url to
Im doing a model association between two models that are called Resume and Province.
I have two models which are linked in a has_one / belongs_to association; Computer
I have two models which are linked in a has_one / belongs_to association; Computer

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.