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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:51:42+00:00 2026-05-19T14:51:42+00:00

Recently we decided to make a general guideline for certain Rails3 project. And we

  • 0

Recently we decided to make a general guideline for certain Rails3 project. And we experienced some troubles to formalize criteria: where code should be placed?

For models we end up with following:
Method should be added to the model if…

  1. it changes attributes of the model.
  2. it works as shortcut for long sequence of calls of model’s methods and has a good(semantic) name.
  3. it redefine some functionality.
  4. it needs to be inserted due to architectural issues.

Method should not be inserted if…

  1. it is used for representing data (except cases when Aggregations work).
  2. it is syntax sugar (syntax should be persistent)
  3. it returns constant value (use constants or class variables)
  4. it is alias for other method (use standard ruby ways to create aliases)
  5. it has more-less complex logic and does not change anything in the db (move it to the lib)

What also can be added as criterion? Which books\articles covers such questions?

  • 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-19T14:51:43+00:00Added an answer on May 19, 2026 at 2:51 pm

    I highly recommend that you read Rails Antipatterns: Best Practice Ruby on Rails Refactoring. A lot of what you’ve covered here is discussed, but it’s more of a best practices book. A lot of the topics are fairly obvious if you’ve been working with Rails for a while, but it’s a great resource for “checking-in” on your coding practices. I’ve lent it to other developers on my team and they’ve given really positive feedback on it.

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

Sidebar

Related Questions

In my project, I recently decided to use boost::thread. My code compiles fine under
I started a Rails project recently and decided to use RESTful controllers. I created
I recently started a new webforms project and decided to separate the business classes
NOTE: I'm a veteran Java developer (10yrs) and have recently decided to make things
I'm decently experienced with Python and Java, but I recently decided to learn C++.
I've been working with some event handling in Javascript and recently decided to migrate
I have a personal learning project that I shelved for awhile but recently decided
One of my non-programmer friends recently decided to make a C++ program to solve
I recently decided to try to learn some bash scripting and as a fun
I recently took all my code a manually imported it into an eclipse project

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.