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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:52:25+00:00 2026-05-29T20:52:25+00:00

I have a database with several tables, each one containing columns that may not

  • 0

I have a database with several tables, each one containing columns that may not follow the rails naming convention.
Is there a tool existing to create the ActiveRecord models from those tables or do I need to do this at hand, one by one ?

If I create the ActiveRecord model for one table by hand, would this be ok though ? (no hidden DB identifier needed on top of it ?)

UPDATE

I have tried magicmodels but cannot have it working (it has been a while since it was last modified) and does not seem to be compatible with rails 3.2

What I tried then:

- change the database.yml so it points towards my existing Postresql database
- manually create my models such as:

    # app/models/user.rb
    class User < ActiveRecord::Base
    end

- run the console and tried
    User.all

=> I end up with an error saying that contant User was not initialized.  
Doesn't the console import the model automatically ? Or is that linked to the fact the configuration I did is not correct ?
  • 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-29T20:52:28+00:00Added an answer on May 29, 2026 at 8:52 pm

    ActiveRecord works OK with legacy databases. I did a back-end system that didn’t use Rails with ActiveRecord as my ORM. “ActiveRecord Without Rails” got me started. “Using ActiveRecord outside Rails” is also useful. Search Google for “use activerecord without rails” and you’ll find even more.

    You don’t need a fully fleshed out model. Just use a base class for the tables you want and ActiveRecord will query the database for what it needs. It won’t know about table relationships, but for general queries it’ll do fine. Build the relationships as you go and need them.

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

Sidebar

Related Questions

I have several database tables that just contain a single column and very few
I have a SQL Mobile database with one table. It has several columns with
I have a SQLite database, and several tables within that datbase. I am developing
I have an Access database (in Access 2003) with several tables, and data must
Let's say we have system A comprising a MySQL database, with several tables. After
I have a product database with several product categories. Each category has a number
Our scenario: We have a main database that stores company-wide information. We have several
I have several sql queries that I simply want to fire at the database.
I have a SQL Server that houses Several Databases. I have a Main Database
I have a DB model that uses several tables to hold business logic data;

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.