IT Blog, Web Development,

Ruby on Rails: Another 5 Not So Frequent Programmer Traps

2 m read
QArea Expert
QArea Expert Marketing Manager
June 13, 2014
Share on
Reading Time: 2 minutes

In the previous article “Ruby on Rails: 5 Most Frequent Programmer Traps” we’ve discussed the most common mistakes developers are prone to while coding in “Rails”.

This time our Ruby on Rails outsourcing team has prepared another set of 5 traps, not so common but still dangerous, you should watch out for while building your products with Ruby on Rails.

Here are they.

  1. Log Files Ignored

While many apps use log monitoring tools such as New Relic and Honeybadger in production, it’s nevertheless important to have an eye on the log files during the developing and testing processes in order to timely get cues about any inefficiencies in the code and to have a chance to correct these before your product goes into production. If you neglect this practice, you’re likely to find about some resulting performance issue when the system’s already live.

  1. Few Automated Tests

Both Ruby and Rails offer powerful test automation capabilities by default. Despite add automated testing into a Rails application is easy, many projects out there still have very few tests written. Therefore, it’s recommended that each controller action has a high-level integration test.

  1. Calls To Third Party Services Blocked

External Rails service providers normally make integration of their services in your app very easy via gems wrapping their APIs. To avoid blocking of the calls to such services, move them to some queuing service for background job if possible. Try such popular Rails gems as Resque, Delayed job, and Sidekiq for this purpose.

  1. Too Much Affection For Existing Database Migrations

The database migration mechanism of Ruby on Rails gives you a great way of managing granular changes in your product’s database schema. At the beginning it always works perfect, but as time passes, the process of database creation can take much time and migrations often get misplaced and out of order. When this happens and running migrations takes too long, developers should have courage to clear out their old directory, dump the new schema and go on from that point.

  1. Sensitive Data Checked Into the Source Code Repository

The file containing a secret token used to secure a browser session often gets mistakenly checked into source code repositories along with the rest of the app which lets anyone who has the repository access easily compromise your app users. So make sure the file with the token is excluded from the repository configuration file.

Conclusion

Ruby on Rails makes a powerful framework which hides many tricky details necessary to develop a robust web product. While this ensures a fast web application development process, developers need to pay attention to certain potential coding and design pitfalls in order to make sure their apps are highly extensible and maintainable even as they grow.

Share on
Privacy Preference Center
Your Privacy

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.

Strictly Necessary Cookies Always Active

These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.

You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.

Performance Cookies

These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site.

All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.

Cookies used

Google Analytics
Functional Cookies

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.

Cookies used

Test Second Test
Targeting Cookies

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.

More Information

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.