• July 03, 2021

    Rails Batch Processing Of Records For destroy_all

    In Ruby on Rails, we use destroy_all when we want to delete a collection of ActiveRecord::Relation records. Example: As we notice above in the logs, all the records were loaded into the memory at a time and then DELETE transaction was initiated for…

    Read more →

  • May 23, 2021

    Rails 7.0 Added Sole Finder Methods

    Rails has several finder methods like find, find_by, last, first, etc. in ActiveRecord to query the database to find a single record. Let's understand how we use find_by or first methods with the help of an example. If we are asked to update a…

    Read more →

  • May 15, 2021

    Ruby 3.1 Added intersect? Method To Array

    While working on a Ruby project at times we may need to find whether two arrays have any common items. In Ruby '&' operator is popularly used for this. Let's quickly look at an example. Ruby 2.7.0 introduced Array#intersections which helped us to…

    Read more →

  • October 01, 2020

    Ruby 3.0 Freezes Range Objects

    In past, Ruby had made some of the objects frozen by default and those were the objects of Symbol, Integer, Float, TrueClass, FalseClass, NilClass, etc. Ruby core team has been very cautious in past while making any object frozen to ensure these…

    Read more →

  • September 16, 2020

    Ruby 3.0 Interpolated Strings Are No Longer Frozen

    In Ruby, frozen_string_literal: true makes all string literals frozen by default and it helps in reducing needless memory allocations by not creating a new allocation each time a string is redefined. In Ruby 2.7.1 and earlier versions, interpolated…

    Read more →

  • September 12, 2020

    Ruby 3.0 Added Leading Arguments Forwarding

    Ruby 2.7.0 introduced a shorthand syntax to forward arguments to another method. Although ... is a nice addition to Ruby 2.7.0 but it does not help if we want to be little selective like catching one argument and passing the rest to another method…

    Read more →

  • September 11, 2020

    Ruby 3.0 Added name Method For Symbols

    In Ruby, symbols are immutable and strings are mutable. If we define a symbol once, then a single memory location is referred everywhere. In short, symbols help us to reduce memory allocations. Rubyists use symbols and strings interchangeably in…

    Read more →

  • September 07, 2020

    Ruby 2.7.0 Allows To Call Private Methods With self

    Before Ruby 2.7.0, we were able to call private attr_writer method using self but were getting an error while calling a private attr_reader method and any other private method. Let's see an example: Before Ruby 2.7.0, the above example would throw an…

    Read more →

  • September 04, 2020

    Why Keyword Arguments Had To Change in Ruby 2.7.0

    Note: This article is all about behavior of Keyword Arguments from Ruby 2.0 to 2.6.6 (latest version of 2.6 release). Keyword Arguments were introduced in Ruby language with version 2.0 and it has been used extensively across many projects because…

    Read more →

  • September 03, 2020

    Introducing scriptday blogs

    Today, we are thrilled to announce the launch of scriptday blogs. The objective of adding the blog section is to share our day to day learnings and experiences with the world. Our blogs will also share recent updates that is happening in engineering…

    Read more →

© All rights reserved 2022