Prem SichanugristinSikachu's BlogIgnore Git revisions in git blameGitHub recently added support for ignoring revisions in git blame, which should be useful for when you have commits that change code style.2 min read·Jul 22, 2022----
Prem SichanugristinSikachu's BlogConfirm current database connection in Rails consoleUseful when you want to avoid running a big query on your main writer database.1 min read·Feb 4, 2022----
Prem SichanugristinSikachu's BlogVim modeline magicIt’s Magic. Modeline Magic.1 min read·Apr 2, 2020----
Prem SichanugristinSikachu's BlogWriting a pass-through method, Ruby 2.7 editionYou may have written a Ruby method which pass all the arguments to the underlying method, and Ruby 2.7 just introduced a new syntax for it.1 min read·Mar 26, 2020----
Prem SichanugristinSikachu's Blogfetch vs. [] || for default value in RubyTL;DR: Use Hash#fetch1 min read·Mar 23, 2019----
Prem SichanugristinSikachu's BlogMissing translations keys — Gotta Catch ’Em All`config.action_view.raise_on_missing_translations = true` actually does not apply to direct `I18n.t` calls. Here’s how to make it do so.1 min read·Oct 23, 2018----
Prem SichanugristinSikachu's BlogThink twice before using double splat in RubyAs of Ruby 2.5.1, double splat operator (**options, for example) is still considerably slower than accepting a normal argument and sets a…1 min read·Jul 4, 2018--1--1
Prem SichanugristinSikachu's BlogA new helper to freeze time in Rails 5.2This one is a simple quality-of-life improvement.1 min read·Jun 8, 2018----
Prem SichanugristinSikachu's BlogExpanded rails routes in Rails 6.0In Rails 6.0, rails routes command will support --expanded (or -x, the shorthand version). This is similar to \x mode in psql where it will…1 min read·Jun 7, 2018----
Prem SichanugristinSikachu's BlogRelation.pick in Rails 6.0Back in 2012, Rails 3.2.0 added a .pluck method which you can call on a ActiveRecord::Relation or a model class:1 min read·Jun 6, 2018----