Recent Posts

  • August 15, 2019

    Ruby Ranges

    Range in ruby can be used in following situations

  • August 05, 2019

    Useful Rails commands

    rails dbconsole, rails runner, rails notes, app and helper objects

  • August 02, 2019

    Rails 6 adds *_previously_was attributes method

    Rails had previous_changes method to track value of object before and after save.

  • July 11, 2019

    Scopes in Rails

    Recently I was calling create method on an active-record model object. But it failed in validation, because the provided foreign_key_id was not present in the associated table.

  • July 07, 2019

    String Comparison: StringInquirer

    Generally we use ==/===/eql?/equal? for string comparison in Rails. It does work in all scenarios we needed. But we often tend to look how same things can be done in more clean ways or how other developers in Rails community would have done that.