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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:20:02+00:00 2026-05-21T10:20:02+00:00

My Rails app (let’s call it Mira) will be interfacing with an existing app

  • 0

My Rails app (let’s call it “Mira”) will be interfacing with an existing app (let’s call it “Jira”). Mira will store information about Jira and will be able to directly manipulate its database (because Jira, we’ll say, has an incomplete API).

Since I want to directly manipulate Jira’s database, it makes sense to have models representing each of Jira’s tables in my Mira app. That way I can use ActiveRecord to manipulate it.

But in fact! There are two Jiras. A Staging instance and a Production instance.

So now I want my model that was happily interfacing with one instance of Jira to be able to use a different database.

It would be super sweet if I could do this when I instantiate my model, perhaps like this:

Jira::CustomField.new(:staging)

or something like that.

Thoughts? Better ways to accomplish this? Is my goal as stated even possible?

  • 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-21T10:20:03+00:00Added an answer on May 21, 2026 at 10:20 am

    As the documentation for ActiveRecord::Base discusses, it is easy to have different Rails model objects connecting to different databases using the establish_connection method.

    However, if you want the same class to connect to multiple databases based on configuration, that will be kind of a pain. Do you need to use ActiveRecord here or could you use DataMapper? That would work better in this scenario I think. Check out What ORM to use in one process multiple db connections sinatra application? for an example

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

Sidebar

Related Questions

Let's say you're implementing rails app for a snowboard rental store. A given snowboard
I have a Rails app that will post some data to another Rails app.
In my rails app I'd like to let users submit custom themes to display
Let's say in a Rails app you have some gems that you use in
Let's say I have a rails app with content that's read-only to the public,
My overall goal is to let users of my Rails app authenticate against our
I have a couple of models in a Rails app. Let's say it's Products
Our rails app is designed as a single code base linking to multiple client
My Rails-app has a sign in box with a remember me checkbox. Users who
In my rails app I use the validation helpers in my active record objects

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.