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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:03:13+00:00 2026-05-30T21:03:13+00:00

I just realised that standard ActiveRecord actually hits the database when you do person

  • 0

I just realised that standard ActiveRecord actually hits the database when you do

person = Person.new(:name => "test")

I suspect ActiveRecord does this to check what fields are available for the model.

However, our legacy database is only occasionally available. That means that our test suite cannot run all the time. Are there any tricks to making this work without a database?

If it’s not possible, we thought of some alternatives:

  • have a local copy of the database and work on that one
  • use another ORM that solves this problem (DataMapper)

Any suggestions are welcome.

  • 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-30T21:03:15+00:00Added an answer on May 30, 2026 at 9:03 pm

    Working with a local copy is only possible if the data touched isn’t changed from anywhere else! Otherwise you will have a database disaster soon.

    Your suspection is right too. ActiveRecord checks the Database for fields so it needs a connection. I don’t think there is a way to solve this when you want continue using ActiveRecord. I think you need to solve the underlying problem and run a database that is always available!

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

Sidebar

Related Questions

I just realised that this program compiles and runs (gcc version 4.4.5 / Ubuntu):
Trying to just grab the date in this url upload/Standard Project/test/04-12-2011/1.jpg the url will
I just realised that Office 2007 now shows multiple pages per default. I can
I know that it isn't the most vital of issues, but I just realised
I have just realised if I add a particular record to my MySQL database
Haskell blew my mind yet again when I realised that (x,y) Is just syntactic
I just realized that in some place in my code I have the return
I just realized that I need to synchronize a significant amount of data collection
I just realized that the method Element.getElementsByTagName(someTagName) returns a nodelist of all elements in
I just realized that i may not be following best practices in regards to

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.