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

  • Home
  • SEARCH
  • 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 6529649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:39:39+00:00 2026-05-25T09:39:39+00:00

I need to work with pricing data from an external vendor’s parts catalog. Is

  • 0

I need to work with pricing data from an external vendor’s parts catalog. Is it best to create a Rails Model to represent this data or should I import it directly into the database and use pure SQL?

If a Model is the best choice, how do I import the CSV file and save objects for each record?

Any insight will be greatly appreciated.

  • 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-25T09:39:39+00:00Added an answer on May 25, 2026 at 9:39 am

    You can use FasterCSV (included as CSV in Ruby 1.9) to parse the CSV file and create/update each record for each row in the CSV file.

    If you do it this way you have the option of validating each record before you save it. If you instead do as Mischa suggested and import it in to the database and use a Rails model to represent it, you will import the data much faster but lose the ability to perform validations before inserting the data in to the database.

    It is almost certainly a better idea to use a Rails model instead of pure SQL queries (which you would put where?). If you do need custom SQL queries, write them as methods (or scopes if possible) on the model.

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

Sidebar

Related Questions

I need to work with a third-party Java library from .NET. Can anyone recommend
I need to work with an old repository, whose db/format contains 2 From this
I need work with namespaces on XML from a code and do something with
I need to work in velocity, I read the getting started sections from velocity.apache.org
i need to work with 100,000 list of data. sometimes need to remove an
I need to work on the internals of android, especially create and test new
I need to work out a way to create 10,000 non-repeating random numbers in
I need to work with the 3d model of some places. Google Earth has
I need to work with array from several threads, so I use CRITICAL SECTION
I need to work with several data samples, to say, N . The samples

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.