Prem Sichanugrist·Jul 22, 2022Ignore 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.
Prem Sichanugrist·Feb 4, 2022Confirm current database connection in Rails consoleUseful when you want to avoid running a big query on your main writer database.
Prem Sichanugrist·Mar 26, 2020Writing 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.
Prem Sichanugrist·Oct 23, 2018Missing 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.
Prem Sichanugrist·Jul 4, 2018Think 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…A response icon1A response icon1
Prem Sichanugrist·Jun 8, 2018A new helper to freeze time in Rails 5.2This one is a simple quality-of-life improvement.
Prem Sichanugrist·Jun 7, 2018Expanded 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…
Prem Sichanugrist·Jun 6, 2018Relation.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: