15 Followers
21 Following
41 Posts
Senior Ruby on Rails Developer. | Open for new roles.
Contacthttps://haseebeqx.com
LinkedInhttps://www.linkedin.com/in/haseeb-a-45590868/
BirdSitehttps://x.com/Haseebeqx
Githubhttps://github.com/haseebeqx
BigBinary is hiring a few Rails Engineers. Nice opportunity if you are from India and looking for a job change. https://bigbinary.com/careers/ruby-on-rails-engineer
Careers at BigBinary - Ruby on Rails Engineering Role

BigBinary is looking for Software Engineers to build high-quality software for both internal products and clients. In this role, you will be working alongside developers, designers, and QAs to solve problems. You will have the opportunity to deliver high-quality work with clients ranging from fast-growing startups to big enterprise companies while developing and building your own skill set.

BigBinary
Created a new blog post about working in legacy codebases: "Navigating the Maze: How to Start Working on a Legacy Rails Codebase"
https://haseebeqx.com/posts/navigating-the-maze-how-to-start-working-on-a-legacy-rails-codebase/
Navigating the Maze: How to Start Working on a Legacy Rails Codebase | Haseeb Annadamban

Working on a legacy Rails codebase can be challenging. But you can start navigating and working on it effectively with a good strategy. This blog post discusses common steps when working in a legacy codebase. This article does not talk about optimizing the codebase; it is only about understanding and navigating it. Because it does not make any assumptions.

New blog post: Rails 8 authentication generator with user registration

https://haseebeqx.com/posts/rails-8-authentication-generator-with-user-registration/

Rails 8 Authentication Generator With User Registration | Haseeb Annadamban

Before Rails 8 we always used something like the devise gem for authentication. Even though Rails has all the features to build authentication, It was difficult to implement compared to devise gem. Rails 8 addresses this problem with an authentication generator. One good thing about this is that it is completely optional as a generator. You can still go with other authentication providers or build it yourself. The Rails 8 authentication generator includes login, logout, and password reset features. But interestingly it does not include a user registration feature. As per DHH, it is because “those are usually bespoke to each application”. But it is easy to implement. I have created a Rails app template for basic user registration generation. You can easily generate user registration using that.

I created a RailsByte template for #Rails8 authentication generator user registration feature. This makes it easy to generate full authentication and registration. Includes optional email confirmation feature.
Here is how to do it:
```
gem install rails -v 8.0.0.beta1
rails new auth-test
cd auth-test
rails generate authentication
rails app:template LOCATION='https://railsbytes.com/script/Xg8sMD'
```
Source: https://railsbytes.com/public/templates/Xg8sMD

This acts as a starting ground for implementing full authentication

With #Rails, Even loading DB dump has a Rails way.
Created a new blog post on
understanding Indexes as a rails developer https://haseebeqx.com/posts/how-to-add-indexes-based-on-query-plan-as-a-rails-developer/
How to Add PostgreSQL Index based on Query Plan as a Rails Developer | Haseeb Annadamban

As Rails developers, we often focus on writing clean, efficient Ruby code. However, as the application grows optimizing database performance is equally crucial for creating responsive applications. One of the most powerful tools in our arsenal for database optimization is indexing. Here I will talk about PostgreSQL indexing from a Rails developer’s perspective. The query plan generated by EXPLAIN will help us to make informed decisions about index creation, ensuring our database queries run as efficiently as possible.

This is something I always wanted when I saw the first production performance issue back in the day.
Here is my new blog post about PostgreSQL EXPLAIN for #Rails developers https://haseebeqx.com/posts/rails-explain-analyze-explained/
Understanding The Output of EXPLAIN Command As a Rails Developer | Haseeb A

Rails Active Record is a powerful ORM that simplifies database operations, but complex queries can sometimes lead to performance issues. In this post, we’ll explore the Active Record Explain feature and how it understand it’s output. We’ll cover the basics of using Explain, interpreting its output, and give you some hints on applying that knowledge to optimize your database queries. EXPLAIN is a database-level feature. We will be using PostgreSQL for this post. EXPLAIN provides insights into how the database executes your queries, helping you identify and resolve performance issues.

Created a new article with tips for improving #PostgreSQL `.count` performance in #Rails
https://haseebeqx.com/posts/cheat-sheet-for-rails-postgresql-count-performance/
Cheat Sheet for Rails + PostgreSQL Count Performance | Haseeb A

The convenience and power of Active Record allows you to interact with your database in a more Ruby-like way, making it easier to write efficient and readable code. However, as with any complex system, performance can sometimes take a hit when using Active Record. One common scenario where performance may suffer is when counting records in your database. In any Rails app, A simple count method call can quickly become a bottleneck, especially for larger datasets. In this post, we’ll dive into some optimization techniques for using Active Record’s count method in your Rails app.

Created a new blog post about generating custom #rails `generate` command to generate fully scaffolded pages including controllers, models, pundit authorization, and service objects. https://haseebeqx.com/posts/building-custom-generators-in-rails/
Building Custom Generators in Rails | Haseeb A

In Ruby on Rails, A generator is a tool that helps create scaffolding (basic code structure). By default, Rails provides several built-in generators like rails generate scaffold, rails generate controller, etc. Many of the gems come with their own Rails generators too. A custom generator is used to create a customized scaffolding for your application. Custom generators in Rails allow developers to create their code generators to streamline repetitive tasks and enforce consistency across the codebase.

#Rails Tip: You can use Rails attributes API in value objects to make use of built-in parsing. This is applicable in some usecases. Also added a blog post in this topic http://haseebeqx.com/posts/lets-start-using-attributes-api/
Let's Start Using Rails Attributes Api | Haseeb A

When building applications in Ruby on Rails, We store data in Plain Old Ruby Object (called PORO) value objects. This is a common pattern, We store data directly in service objects using attr_accessor. But in some cases we might have to cast data from string. For this, we do have to cast those attributes. Traditional approach 🔗class Product attr_accessor :name, :price, :released_at, :in_stock def initialize(attributes = {}) @name = attributes[:name] @price = parse_price(attributes[:price] || '0') @released_at = parse_datetime(attributes[:released_at]) @in_stock = parse_boolean(attributes[:in_stock]) end private def parse_price(value) BigDecimal(value.