Articles by Alkesh Ghorpade
Jul 26, 2022
Rails 6 bulk insert records
Rails 6 adds insert_all and upsert_all methods to ActiveRecord
Feb 16, 2022
Ruby 3.1 adds error highlighting gem
With changes in Ruby 3.1, we will be able to know which object is nil when an error gets raised.
Jan 5, 2022
How to Use Enums in Rails
A deep dive into what enums are, how to create and configure enums using Rails.
Nov 24, 2021
Ruby 3.1 adds MatchData#match and MatchData#match_length
Ruby 3.1 MatchData#match returns the substring corresponding to the argument, while MatchData#match_length returns the length of the captured substring.
Oct 13, 2021
Rails 7 introduces ActiveModel::API
ActiveModel::API allows adding more functionality to ActiveModel::Model and makes itself a minimum API to interact with Action Pack and Action View.
Oct 5, 2021
Rails 7 adds ActiveRecord::QueryMethods#in_order_of to return query results in a particular sequence
Starting with Rails 7, we can return ActiveRecord::Relation results in provided series using the in_order_of method.
Aug 18, 2021
Starting with Rails 7, retry failed jobs indefinitely
Pass `:unlimited` symbol to `attempts` parameter of ActiveJob's `retry_on` method, which allows a developer to specify that a job should retry forever until it succeeds.
Jul 14, 2021
Rails 7 adds support for `if_exists/if_not_exists` on `remove_foreign_key/add_foreign_key`
Rails 7 adds support for `if_exists/if_not_exists` on `remove_foreign_key/add_foreign_key` in migrations to silently ignore raised exceptions.
May 25, 2021
Rails 7 adds range serializer for ActiveJob
ActiveJob in Rails 7 allows a range to be passed as an argument to perform method.
May 18, 2021
Ruby 3.1 adds Array#intersect? method
Ruby Array#intersect? method will return true or false based on common elements present in the two arrays.
Mar 30, 2021
Rails 6.1 adds `if_exists` option in `remove_index` operation
Rails 6.1 adds the `if_exists` option in `remove_index` which when set to true won't raise an error if the index doesn't exist.
Jan 25, 2021
Rails 6.1.1 allows `where` to reference associations via joined table alias names.
Rails 6.1 allows where clause queries to reference associations used in `join` or `includes` clause via alias names.
Jan 8, 2021
Rails 6.1 adds support for role switching and sharding in database
Rails 6.1 has added support for switching connections for one database instead of all databases
Jul 27, 2020
Rails makes ActiveStorage `web_image_content_types` configurable
Rails added web_image_content_types config option to ActiveStorage, which allows an application to add content types instead of letting the images be transformed into the fallback PNG format.
Jun 17, 2020
Encapsulate each validation error as an Error object
ActiveModel::Error class has changed from Hash based interface to an array of Error objects.
May 6, 2020
Using Interactors in Rails
Interactors provide a common interface for performing complex user interactions.
Apr 27, 2020
Rails - Added sub seconds to Time inspect
Rails has added sub seconds to ActiveSupport::TimeWithZone#inspect method.
Mar 18, 2020
Rails - Allows to specify schema cache path in database configuration file
Rails now exposes a new configuration for specifying the location of the schema cache file. This can be done in database.yml using schema_cache_path key.
Feb 14, 2020
Rails adds ActiveRecord API for switching multiple database connections
Rails adds ActiveRecord API connects_to and connected_to for switching connections to support multiple databases.
Feb 12, 2020
Rails introduces disallowed deprecations in ActiveSupport
Rails has added support to configure disallowed deprecations.
Feb 4, 2020
Rails 6 - ActiveSupport Deprecations in Unicode and Chars support in favour of String
Rails 6 has deprecated methods in Unicode and Chars support for ActiveSupport in favor of using ruby 2.3+ String methods directly.
Feb 3, 2020
Rails 6.1 adds support for multiple storage services to Active Storage
Rails 6.1 adds support to configure storage services for individual attachment.
Jan 28, 2020
Ruby 2.7 - Singleton class yield syntax throws a warning
Ruby 2.7 singleton class yield syntax is warned and will be deprecated in Ruby 3.0.
Dec 23, 2019
Ruby 2.7 - Time#inspect separated from Time#to_s
Ruby 2.7 separated Time#inspect from Time#to_s and added sub seconds
Dec 10, 2019
Rails 6 adds ability to block writes to a database
Rails 6 adds the ability to block writes to a database even if the database user is able to write using connection.while_preventing_writes
Nov 4, 2019
Rails 6 - Active Storage changes
Rails 6 brings in image_processing gem, support for different image types and improvements in Active Storage.
Oct 29, 2019
Rails 6 adds after_save_commit
Rails 6 adds after_save_commit callback shortcut.
Oct 23, 2019
Ruby Lazy Enumerators
Ruby support for lazy loading enumerators
Oct 15, 2019
Rails 6 adds delete_by and destroy_by methods.
Rails 6 ActiveRecord::Relation added two new methods delete_by and destroy_by.
Sep 11, 2019
Rails 6 - Custom Serializers for ActiveJob arguments
Rails 6 introduces ability to provide custom serialization of ActiveJob arguments.
Sep 9, 2019
Rails 6 adds support for disabling database advisory locks
Rails 6 adds support for database configuration to disable advisory locks
Aug 18, 2019
Rails 6 - I18n key support for submit_tag key
Rails 6 adds I18n style locale key support to submit tag
Aug 7, 2019
Rails 6: Introduces explicitly adding rails server handler option
Rails 6 introduced --using or -u option for specifying the rails server