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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:06:07+00:00 2026-05-26T18:06:07+00:00

This is for a Ruby on Rails 3.0.x project. I have a lookup table

  • 0

This is for a Ruby on Rails 3.0.x project.

I have a “lookup” table with data from a vendor.

When I import data from another source, I want to check this table (join on a SKU) for extra data.

It doesn’t seem right to me to create a model for this table in my app. The data will never be changed by my app, and it doesn’t need to have any model associations beyond the data lookup I just mentioned. It’s just occasionally accessed to check for some info.

What is the best practice to access this table?

Thanks.

  • 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-26T18:06:08+00:00Added an answer on May 26, 2026 at 6:06 pm

    There’s no harm in creating a model around it, but if you’d like to avoid it, you will have to send raw SQL queries to the DB to get data back as an alternative.

    Raw queries: Rails raw SQL example

    On the other hand, I think the motivation for wrapping a model around it goes beyond whether or not you want to modify it. I definitely have apps that have models around tables that never change (i.e. a list of app-specific terminology, a list of cities/states, and other static data that is imported once and never changed). ActiveRecord will also wrap the columns into easily accessible methods, so you can read that data easily, not to mention all the convenience methods around sorting, finding, etc.

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

Sidebar

Related Questions

This is not a ruby/rails project deploy. I have the following situation and I
I'm new on both this site and ruby on rails! I have a common
this time it's about Ruby On Rails. I have a form in the view
The default in Ruby on Rails is to have this set to false (in
I have a Ruby on Rails project that has been untouched for a while,
I have repository at github for ruby on rails project. First time i did
I have an existing Ruby on Rails project. How do I find out which
I have a simple ruby on rails project that I'm trying to use a
I have a javascript plugin in my rails project that loads an image this
What is best way to refactor in Ruby on Rails. I have a project

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.