Blog

Thoughts from my daily grind
Posted by Ziyan Junaideen 04 June 2022
Enums are a useful and commonly used data type in Ruby applications. Rails 7 introduces support to create native PG enum data types. This post discusses the creation and use of native enums with PostgreSQL, advantes & disadvantages.
Posted by Ziyan Junaideen 12 May 2022
Fix the error when bundle install of a Ruby on Rails project w.r.t. nio4r. The issue generally is the result of implicit function declaration causing errors compiling native C extensions.
Posted by Ziyan Junaideen 28 March 2022
The popular Ruby on Rails library ActsAsTaggableOn wrongfully selects the parent class in STI resulting empty #tagged_with method output. The solution would be to use a custom query.
Posted by Ziyan Junaideen 25 November 2021
Enable Tailwind CSS with JIT in your Ruby on Rails project using the new `cssbundling-rails` ruby gem. Includes advice for Trailblazer configuration.
Posted by Ziyan Junaideen 24 September 2021
The Cookie Consent prompt negatively affects the effectiveness of landing pages. I recommend you disable them unless necessary. This is how you can disable sessions on routes on your Rails website.
Posted by Ziyan Junaideen 29 May 2021
Those who enjoyed the where.not(...) query method will surely find the query.invert_where query method a welcoming feature. It allows us to easily invert entire queries.
Posted by Ziyan Junaideen 24 August 2019
Learn how you can track an ActiveRecord objects attribute changes across its lifecycle or page request. The methods [attr]_was, [attr]_chagned?, [attr]_previously_was are some among the helpful methods implemented in ActiveModel::Dirty module.