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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:49:22+00:00 2026-05-15T17:49:22+00:00

Lots out there about changing model names only or mapping new models to existing

  • 0

Lots out there about changing model names only or mapping new models to existing tables, but nothing about renaming both at the same time. For now, I’m starting with the DB table and working my way out with Find/Replace in my code, but I’m surprised there isn’t something better or at least someone who’s tried it and written about it.

  • 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-15T17:49:23+00:00Added an answer on May 15, 2026 at 5:49 pm

    The full list of things to rename are:

    1. table name
    2. foreign key column names in associations (model_id columns)
    3. model file name in app/models/
    4. class name in app/models/model.rb
    5. associations in other models (has_one/has_many)
    6. controller file name in app/controllers/
    7. class name in app/controllers/models_controller.rb
    8. folder name in app/views/
    9. resource route in config/routes.rb
    10. fixture file name in test/fixtures/
    11. references to the model in associated fixtures in test/fixtures/
    12. unit test file name in test/unit/
    13. class name in test/unit/model_test.rb
    14. controller test file name in test/functional/
    15. class name in test/functional/models_controller_test.rb
    16. find/replace the class name anywhere in your code

    You should write a migration for the database changes. The rest can be done easily, or you can use your IDE (RadRails/RubyMine) to help. I guess there’s no built in function because there’s no way to know where in your code you’ve used the model.

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

Sidebar

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.