Romil Mehta

Romil Mehta

Romil is a Ruby on Rails Developer who enjoys putting together the technical pieces making sure everything runs smoothly.
authorImg Romil Mehta

Rails 7 Adds associated Query Method

Rails 7 adds ActiveRecord::Relation#associated query method to check for the associated record presence
authorImg Romil Mehta

Rails 6.1 Configurable Attribute Defaults

With Rails 6.1, we can set attribute's default value by keeping the type same
authorImg Romil Mehta

Rails 6 perform_enqueued_jobs Without Block

With Rails 6, we can use ActiveJob::TestCase#perform_enqueued_jobs without a block to perform jobs in tests
authorImg Romil Mehta

Rails Adds db:rollback:name for Multi-DB

Rails has added support for name option while rollbacking migration for multiple database application
authorImg Romil Mehta

Heredocs in Ruby and Rails Explained

What are heredoc and different ways to use them in Ruby and Rails.
authorImg Romil Mehta

Rails Action Cable Adds Stream Unsubscribe

Rails adds ActionCable::Channel#stop_stream_from and ActionCable::Channel#stop_stream_for methods to allow user to unsubscribe from specific stream
authorImg Romil Mehta

Rails 6.1 perform_enqueued_jobs at Option

Rails 6.1 has added at option to perform_enqueued_jobs test helper to run only jobs which are scheduled at or before the passed in time
authorImg Romil Mehta

Rails if_exists/if_not_exists Migrations

Rails adds support for if_exists/if_not_exists on remove_column/add_column in migrations to silently ignore migrations
authorImg Romil Mehta

Rails 6 adds rails db:system:change command

Rails 6 adds rails db:system:change command to allow switching database configuration
authorImg Romil Mehta

Rails 6 adds ActiveSupport::ParameterFilter

Rails 6 has moved ParameterFilter from ActionDispatch to ActiveSupport in order to support filtered attributes with ActiveRecord::Relation#inspect.
authorImg Romil Mehta

Rails 6 - Action Mailbox tryout

Rails 6 has added Action Mailbox to process inbound emails. This post tries a deep dive trying to set it up
authorImg Romil Mehta

Ruby 2.7 Module#autoload? inherit Argument

Ruby 2.7 has added inherit as an optional argument to Module#autoload? to check if a given class or module has an autoload defined for a certain constant
authorImg Romil Mehta

Ruby 2.7 adds UnboundMethod#bind_call method

Ruby 2.7 has added bind_call method to UnboundMethods to avoid the allocation from intermediate Method object
authorImg Romil Mehta

Rails 6 Multi-Environment Credentials

Rails 6 adds multi-environment credentials support, making it easier to manage environment-specific secrets for better security and organization
authorImg Romil Mehta

Ruby 2.7 Adds Integer#[] Range Support

Ruby 2.7 has extended `Integer#[]` to support range arguments which makes expressions cleaner and more readable
authorImg Romil Mehta

Ruby 2.7 adds Module#const_source_location

Ruby 2.7 has added Module#const_source_location to get the source location of a constant
authorImg Romil Mehta

Rails 6 Adds dig to Session Object

Rails 6 has added dig method to ActionDispatch::Request::Session to easily traverse session object's nested hashes
authorImg Romil Mehta

Ruby 2.7 Warns Proc.new/proc Without Block

In Ruby 2.7, Proc.new or proc without a block now emit warnings when a block is passed, while lambda without a block raises an error.
authorImg Romil Mehta

Ruby 2.7 adds FrozenError#receiver

Ruby 2.7 has added `FrozenError#receiver` to return the frozen object on which modification was attempted
authorImg Romil Mehta

Rails 6 Adds touch_all Method to ActiveRecord::Relation

Rails 6 has added touch_all method to ActiveRecord::Relation to update the updated_at timestamp of multiple records at once.
authorImg Romil Mehta

Ruby 2.7 Adds Time#ceil and Time#floor

Ruby 2.7 adds Time#ceil and Time#floor methods to round up and down the decimal part of Time (nanosecond) to the specified digit
authorImg Romil Mehta

Rails 6 Adds Array#extract! Method

Rails 6 adds Array#extract! to remove and return the elements for which the block returns a true value.
authorImg Romil Mehta

Ruby 2.7 Adds Beginless Range Support

A beginless range is experimentally introduced in ruby 2.7.