Software engineering and personal development

Tag: rails (Page 1 of 3)

How to find the PostgreSQL version that you are using

Image source: https://docs.datadoghq.com/integrations/postgres/

If you are actively using Rails for developing your projects, then it’s likely that in at least one of your projects you are using PostgreSQL as the database technology. You have already added the pg in your Gemfile and have already started to use it. Then your client asks you about the version of PostgreSQL that you are using, and you may be confused for a bit about it, as you aren’t sure.

Continue reading

Load and manage your environment variables easily with dotenv gem

You will most probably need to have at least one particular case where you need to store configuration values for your Rails application. Saving these types of values in the environment is one of the principles of a twelve-factor app. It is thus recommended to use a separate file and use environment variables inside your code so that you do not have to change the same value in multiple places. This, however, is not something that you can do really easily unless you use something really helpful like dotenv.

Continue reading

Underestimated testing tool for Rails applications: Execute console commands with real data without fearing of losing it

Img source: careerfoundry.com

There can be cases when you need to test something with the actual data, in a production environment, but you do not want to risk anything. You do not want to even think about the possibility for a data loss of the project that you are working it. Luckily, there is a really beneficial feature that is not that much known from Rails developers is a quick tool that you can use to test out some code without changing any data in your real database.

Continue reading

Remove all whitespace in your strings with the squish method in your Ruby projects

It is really hard to think about a real world project in which you are not going to have strings. As a result, having pre-existing methods for manipulating strings is really productive, as it saves you time. In today’s article, I want to emphasize a particular method in Ruby on Rails, that’s surprisingly not that much well known, which helps you with the whitespaces. Continue reading

Why you need Null Object Pattern and how to implement it

Co-Author: Rexhep Kqiku

There are many programming languages and frameworks out there, which are prepared to be used to solve problems. Although there are billions of problems that we may be asked to solve, there are usually some common themes among many of them. As we usually try to solve business problems, we also want to improve the quality of our work. This way, we have design patterns that are abstractions of some of the best ways to deal with certain situations. Continue reading

« Older posts

© 2024 Fatos Morina

Theme by Anders NorenUp ↑