---
title: "Blogs by Mohit Natoo"
description: "Read BigBinary blog posts by Mohit Natoo."
canonical_url: "https://www.bigbinary.com/blog/authors/mohit"
markdown_url: "https://www.bigbinary.com/blog/authors/mohit.md"
---

# Blogs by Mohit Natoo

Read BigBinary blog posts by Mohit Natoo.

## Posts

### Rails 5.2 adds allow_other_host to redirect_back method

[Rails 5.2 adds allow_other_host to redirect_back method](https://www.bigbinary.com/blog/rails-5-2-adds-allow_other_host-option-to-redirect_back-method)

- Author: Mohit Natoo
- Published: May 30, 2018
- Categories: Rails 5.2, Rails

Rails 5.2 introduces allow_other_host option to redirect_back method to handle
redirection for requests received from a different host

### Rails 5.2 sets version in Gemfile & adds.ruby-version

[Rails 5.2 sets version in Gemfile & adds.ruby-version](https://www.bigbinary.com/blog/rails-5_2-adds-ruby-version-file-and-ruby-version-to-gemfile-by-default)

- Author: Mohit Natoo
- Published: May 7, 2018
- Categories: Rails 5.2, Rails

Rails 5.2 sets Ruby version in Gemfile and adds.ruby-version file by default.

### Rails 5.2 fetch_values for HashWithIndifferentAccess

[Rails 5.2 fetch_values for HashWithIndifferentAccess](https://www.bigbinary.com/blog/rails-5-2-implements-fetch_values-for-hashwithindifferentaccess)

- Author: Mohit Natoo
- Published: December 6, 2017
- Categories: Rails 5.2, Rails

Starting Rails 5.2 we'll be able to make use of fetch_values
HashWithIndifferentAccess analogous to its use on Hash.

### Ruby 2.5 introduces Dir.children and Dir.each_child

[Ruby 2.5 introduces Dir.children and Dir.each_child](https://www.bigbinary.com/blog/ruby-2_5-introduces-dir-children-and-dir-each_child)

- Author: Mohit Natoo
- Published: November 21, 2017
- Categories: Ruby 2.5, Ruby

Ruby 2.5 introduces methods new methods to have file names in a directory
without \`.\` and \`..\`

### Rails 5.1 doesn't load all records on calling Model.all#inspect

[Rails 5.1 doesn't load all records on calling Model.all#inspect](https://www.bigbinary.com/blog/do-no-load-all-records-on-activerecord-relation-inspect)

- Author: Mohit Natoo
- Published: November 14, 2017
- Categories: Rails 5.1, Rails

Rails 5.1 limits number of records while calling inspect on
ActiveRecord::Relation object.

### Rails 5.2 expiry option for signed & encrypted cookies

[Rails 5.2 expiry option for signed & encrypted cookies](https://www.bigbinary.com/blog/expirty-option-for-signed-and-encrypted-cookies-in-Rails-5-2)

- Author: Mohit Natoo
- Published: October 9, 2017
- Categories: Rails 5.2, Rails

Rails 5.2 adds expiry option for signed and encrypted cookies and adds relative
expiry time

### Rails 5.1 adds support for limit in batch processing

[Rails 5.1 adds support for limit in batch processing](https://www.bigbinary.com/blog/rails-5-1-adds-support-for-limit-in-batch-processing)

- Author: Mohit Natoo
- Published: May 23, 2017
- Categories: Rails 5.1, Rails

Rails 5.1 can now limit the number of records fetched for batch processing.

### Rails 5.1 doesn't share thread_mattr_accessor variable

[Rails 5.1 doesn't share thread_mattr_accessor variable](https://www.bigbinary.com/blog/rails-5-1-does-not-share-thread-mattr-accessor-variable-with-sub-class)

- Author: Mohit Natoo
- Published: May 16, 2017
- Categories: Rails 5.1, Rails

Rails 5.1 now does not share the variable defined by thread_mattr_accessor with
subclass.

### Ruby 2.4 adds Enumerable#uniq & Enumerable::Lazy#uniq

[Ruby 2.4 adds Enumerable#uniq & Enumerable::Lazy#uniq](https://www.bigbinary.com/blog/enumerable-uniq-and-enumerable-lazy-uniq-part-of-ruby-2-4)

- Author: Mohit Natoo
- Published: March 21, 2017
- Categories: Ruby 2.4, Ruby

In Ruby 2.4, uniq elements can be iterated upon for enumerable and lazy objects
without creating an array.

### Ruby 2.4 implements Enumerable#sum

[Ruby 2.4 implements Enumerable#sum](https://www.bigbinary.com/blog/ruby-2-4-introduces-enumerable-sum)

- Author: Mohit Natoo
- Published: November 2, 2016
- Categories: Ruby 2.4, Ruby

In Ruby 2.4, every object belonging to the \`Enumerable\` family can now call
\`sum\` method on it

### Rails 5 Conversion when deep munging params

[Rails 5 Conversion when deep munging params](https://www.bigbinary.com/blog/rails-5-does-not-convert-blank-array-to-nil-in-deep-munging)

- Author: Mohit Natoo
- Published: July 6, 2016
- Categories: Rails 5, Rails

Rails 5 persists with the empty are in deep munging and does not convert it to
nil.

### Rails 5 ensures compatibility with Rack frameworks

[Rails 5 ensures compatibility with Rack frameworks](https://www.bigbinary.com/blog/rails-5-ensures-compatibility-between-action-dispatch-session-and-rack-session)

- Author: Mohit Natoo
- Published: June 30, 2016
- Categories: Rails 5, Rails

Rails 5 introduces \`each\` method in ActionDispatch::Request::Session to ensure
compatibility between Rails and other Rack frameworks.

### Rails 5 Updating records in AR Relation

[Rails 5 Updating records in AR Relation](https://www.bigbinary.com/blog/rails-5-allows-updating-relation-objects-along-with-callbacks-and-validations)

- Author: Mohit Natoo
- Published: June 10, 2016
- Categories: Rails 5, Rails

Rails 5 modified the ActiveRecord::Relation#update method to now support update
on the relation. It also runs callbacks and validations on the records.

### Rails 5 adds finish option in find_in_batches

[Rails 5 adds finish option in find_in_batches](https://www.bigbinary.com/blog/rails-5-provides-finish-option-for-find-in-batches)

- Author: Mohit Natoo
- Published: June 6, 2016
- Categories: Rails 5, Rails

Rails 5 has an option to provide end value in find_in_batches method

### Rails 5 introduces country_zones helper method

[Rails 5 introduces country_zones helper method](https://www.bigbinary.com/blog/rails-5-introduces-helpers-for-country-zones)

- Author: Mohit Natoo
- Published: June 1, 2016
- Categories: Rails 5, Rails

Rails 5 now allows to fetch information about all the timezones in a particular
country by introductin of a new helper method.

### Rails 5 ArrayInquirer and checking array contents

[Rails 5 ArrayInquirer and checking array contents](https://www.bigbinary.com/blog/rails-5-introduces-active-support-array-inquirer)

- Author: Mohit Natoo
- Published: May 27, 2016
- Categories: Rails 5, Rails

Rails 5 has wrapped Array in an ArrayInquirer giving us a friendlier way to
check its contents. This post also explains its usage in request variants.

### Rails 5 Renaming transactional fixtures to tests

[Rails 5 Renaming transactional fixtures to tests](https://www.bigbinary.com/blog/rails-5-renamed-transactional-fixtures-to-transactional-tests)

- Author: Mohit Natoo
- Published: May 26, 2016
- Categories: Rails 5, Rails

Rails 5 renamed use_transactional_fixtures method to use_transactional_tests.
This was to make it clear that its functionality has nothing to do with use of
fixtures.

### Rails 5 Attributes from Active Record to Active Model

[Rails 5 Attributes from Active Record to Active Model](https://www.bigbinary.com/blog/rails-5-moved-assign-attributes-from-activerecord-to-activemodel)

- Author: Mohit Natoo
- Published: May 17, 2016
- Categories: Rails 5, Rails

In Rails 5 we can use attribute assignment outside of Active Record inherited
classes

### Rails 5 Configure Active Job backend adapter for jobs

[Rails 5 Configure Active Job backend adapter for jobs](https://www.bigbinary.com/blog/rails-5-allows-to-inherit-activejob-queue-adapter)

- Author: Mohit Natoo
- Published: May 15, 2016
- Categories: Rails 5, Rails

Rails 5 provides support to configure queue_adapter at job level and this
queue_adapter can be inherited by child jobs.

### Rails 5 accepts 1 or true for acceptance validation

[Rails 5 accepts 1 or true for acceptance validation](https://www.bigbinary.com/blog/rails-5-accepts-1-or-true-for-acceptance-validation)

- Author: Mohit Natoo
- Published: May 13, 2016
- Categories: Rails 5, Rails

Rails 5 now allows accepting true in acceptance validation. Previously only "1"
was accepted in acceptance validation.

### Rails 5 Sending STDOUT via environment variable

[Rails 5 Sending STDOUT via environment variable](https://www.bigbinary.com/blog/rails-5-allows-to-send-log-to-stdout-via-environment-variable)

- Author: Mohit Natoo
- Published: April 12, 2016
- Categories: Rails 5, Rails

Rails 5 has introduced an environment variable, with the help of which logs can
now be directed to STDOUT in production environment.

### Rails 5 changed Active Job default adapter to Async

[Rails 5 changed Active Job default adapter to Async](https://www.bigbinary.com/blog/rails-5-changed-default-active-job-adapter-to-async)

- Author: Mohit Natoo
- Published: March 29, 2016
- Categories: Rails 5, Rails

The default Active Job adapter has been changed to Async from Inline in Rails 5.

### Caching result sets and collection in Rails 5

[Caching result sets and collection in Rails 5](https://www.bigbinary.com/blog/activerecord-relation-cache-key)

- Author: Mohit Natoo
- Published: February 2, 2016
- Categories: Rails 5, Rails

Rails 5 provides cache_key for ActiveRecord::Relation that can help in caching
result of a collection of records.

### Caching in development environment in Rails 5

[Caching in development environment in Rails 5](https://www.bigbinary.com/blog/caching-in-development-environment-in-rails5)

- Author: Mohit Natoo
- Published: January 25, 2016
- Categories: Rails 5, Rails

Rails 5 has added ability to enable cache in development environment without
changing environment.rb file. This blog post discusses the feature.

### Rails 5 wraps all rake commands using rails

[Rails 5 wraps all rake commands using rails](https://www.bigbinary.com/blog/rails-5-supports-rake-commands-using-rails)

- Author: Mohit Natoo
- Published: January 14, 2016
- Categories: Rails 5, Rails

In Rails 4 some commands use rake and some commands use rails. Rails 5 brings
consistency by having rails command to do everything.

### How constant lookup and resolution works in Ruby on Rails

[How constant lookup and resolution works in Ruby on Rails](https://www.bigbinary.com/blog/how-constant-lookup-happens-in-rails)

- Author: Mohit Natoo
- Published: November 5, 2015
- Categories: Rails

Rails has its own way of maintaining constants and looking for it when it is not
found. This blog discusses all that and much more.

## Links

- [Human page](https://www.bigbinary.com/blog/authors/mohit)
