Rails 7.1 Allows ActiveRecord::Relation#explain To Accept OptionsAdding analyze and verbose as ActiveRecord::Relation#explain options give us deeper insight into query performance.
Rails 7.1 Introduces ActiveRecord regroup MethodWith regroup and regroup! methods we can override the group_values
Rails 7.1 allows resetting singular associationsQuery database again to retrieve the associated record by resetting the cache on singular associations.
Rails 7.1 Introduces Option To Disable All Methods That ActiveRecord.enum GeneratesDisable auto generated methods of ActiveRecord.enum with instance_methods by passing false to it.
Rails 7.1 Adds path_params Option For url_for Helper Methodpath_params allows specified params to be used exclusively for named segments under scoped routing without unnecessarily appending parameters to every URL.
Ruby 3.3 Implements Range#reverse_each Method For Very Large or Beginless Ranges And Error Handling For Endless RangesRange#reverse_each can now process beginless ranges with an Integer endpoint and raises TypeError for endless ranges.
Automate Fly Postgres Database Backup & Store To S3 bucket With GitHub ActionsDiscover how GitHub Actions empowers automation to effortlessly backup Fly.io hosted postgres databases, saving backups to a designated S3 bucket.
Rails 7.1 Allows ActiveRecord reselect Query Method To Accept HashUse of hash syntax for specifying columns and aliases with the ActiveRecord::QueryMethods#reselect method makes it easier for querying.
Ruby 3.3 Introduces Range#overlap? methodCompare two ranges and see if they overlap each other. overlap? returns true if two ranges overlap each other, otherwise false.
Rails 7.1 Introduces Default DockerfilesDockerfiles facilitate the deployment of Rails applications in production environments using Docker.
Rails 7.1 Adds ActiveJob#perform_all_later To Enqueue Multiple Jobs At Onceperform_all_later allows us to enqueue multiple jobs that belong to different classes simultaneously within ActiveJob.
Rails 7.1 Expands ActiveRecord API with Async Query SupportWith the Active Record API for general async queries we can efficiently query not so fast queries asynchronously to improve the performance.
Rails 7.1 Introduces ActiveRecord::Base::generates_token_forGenerate tokens for specific purposes and verify their authenticity.
Rails 7.1 Introduces ActiveRecord::Base::NormalizationNormalization allows us to define custom normalization rules for attributes in our model. This feature is particularly helpful for ensuring that specific attributes are consistently formatted or transformed before they are saved to the database.
Rails 7.1 Introduces Autoload Lib and Ignore Sub-Directories with config.autoload_lib(ignore:) MethodAutoloading lib directory isn't always straightforward. In this blog post, we'll delve into the autoloading of the lib directory using config.autoload_lib(ignore:).
Set And Restore Public Attributes Around a Block Using Object#withWe can use Object#with method as shorthand for the common begin/ensure pattern to save the value of an attribute, setting a new value, and then restoring the previous value.
React state management - useReducer vs ReduxThis blog explores useReducer vs Redux, delving into their definitions, use cases, code samples and when to choose each for efficient state management.
Open Ranges Are Now Supported By The Object#in? Method In RailsWe can use Object#in? method to check open date ranges i.e. beginless and endless ranges.
When to extract code to React custom hooks?React custom hooks help us to build reusable logic, and make the code more readable. In this blog, we will talk about when and when not to use react custom hooks.
Rails adds the ability to ignore tables in SQL schema dumps via regular expressionsIgnore tables by configuring regular expressions on ActiveRecord::SchemaDumper.
Rails now supports routes prefixed with word cableRails improved its support for routes which helps us to navigate to routes prefixed with word cable which were throwing 404 errors before.