Rails 8.1 introduced except_on option for validations and callbacks
To skip validations for particular contexts, Rails added `except_on` option for validations and callbacks.Rails 8.1 update_all with joins Support
Rails 8.1 has improved Active Record functionality by enhancing the support for update_all with joins for Postgresql and SQLite.Rails 8.1 now sorts table columns
Rails 8.1 sorts table columns by name when dumping schema, avoiding merge conflicts when two branches modify the same table concurrently.Rails 8 Dev Container Without Redis
With Rails 8, applications use the Solid Queue and Solid Cache gems by default, so it do not include redis in the dev container.Rails Self-Join UPDATE for Outer Joins
Rails no more generates the subqueries as it uses self-join for `UPDATE` with outer joins on PostgreSQL and SQLite.Rails 8 adds built in authentication
Rails 8's built-in authentication generator offers a lightweight, secure alternative to Devise with full control.Rails Stops Generating bin/bundle Binstub
In new Rails applications, the bin/bundle is no longer included by default, as managing the correct Bundler version is now handled directly by RubyGems.Rails 8 Removes Default Channels Folder
With Rails 8, channels folder dropped from default app/ structure as Hotwire is default in Rails.Rails ActiveModel Normalization
Rails brings attribute normalization to ActiveModel, allowing custom formatting rules for model attributes.Rails Strong Parameters Deep Dive
Explore Rails Strong Parameters, their role in preventing mass assignment vulnerabilities, and how they enhance security and maintainability.Rails 8 Script Folder and Generator
The new script folder to hold one-off or general purpose scripts, such as data migration scripts, cleanup scripts and a scripts generator.Rails 8 ISO 8601 TimeWithZone#inspect
Rails 8 ensures TimeWithZone#inspect aligns with Ruby standards, ensuring time formatting consistency across the board by supporting ISO 8601 Style.What Is New In Ruby 3.4: Key Features
Ruby 3.4 brings performance boosts with GC, YJIT, Prism parser, frozen_string_literal, and block parameters.Rails 8 add_enum_value if_not_exists
Rails 8 introduces if_not_exists option on add_enum_value, we can now safely add a new enum value, preventing errors if the value already exists.Rails 8 Parameters#expect Method
Learn how Rails 8's Parameters#expect enhances parameter handling to safely filter and require params, improving security and reducing application errors.Rails 8 drop_table Accepts Array
Rails 8 allows dropping multiple tables in one call with drop_table by accepting an array of table names in a single migration.Rails 8 Multiple Rate Limits Per Controller
Rails 8 introduces the ability to define multiple rate limits within a controller, offering better flexibility for traffic management.Rails 7.2 explain Method Enhancements
With Rails 7.2, the object returned by explain now responds to pluck, first, last, average, count, maximum, minimum, and sum methods.Rails 7.1 Counter Methods Accept By Arg
Rails 7.1 adds a `by` argument to increment_counter and decrement_counter, allowing updates by custom amounts instead of just 1.Rails 7.1 application.deprecators Method
Rails 7.1 adds Rails.application.deprecators for fine-grained control over deprecation warnings, including debug mode and silencing.Rails 7.1 Validators Accept Lambdas
With Rails 7.1, we can use lambdas without record argument with ActiveModel validators.Rails 7.2 Job Scheduling in Transactions
In Rails 7.2, ActiveJob delays job enqueuing until the transaction is committed and drops the job if the transaction is rolled back.Rails 7.1 Controller Generator --parent
With Rails 7.1, the controller generator now accepts the --parent option. This allows us to generate a controller that inherits from the specified parent class.Rails 7.1 Array#intersect? for AR Relations
Rails 7.1 added Array#intersect? method which returns true if two ActiveRecord relation objects have at least one element in common, otherwise returns false.Rails 7.1 Reserved Attribute Name Error
Rails 7.1 raises error when we generate model with reserved attribute names.Rails 7.1 --unused Routes Option
With Rails 7.1, identify and manage unused routes declared in the application by using bin/rails routes --unused option.Rails inverse_of in Associations
Explore the inverse_of option in Rails associations, highlighting its benefits in performance, data consistency, and optimizing bi-directional relationships.Rails 7.1 exclude? and extract_value Methods
Rails 7.1 adds exclude?, returning true if a key is missing from parameters. And extract_value, which splits a parameter value by delimiter into an array.Rails 7.1 in_batches Descending Order Fix
With Rails 7.1, in_batches method without a block works fine for both `ASC/DESC` order values.Rails 7.1 after_discard for ActiveJob
Rails 7.1 introduces the after_discard method, allowing us to run a callback when a job is about to be discarded.Rails 7.1 AR Transaction Instrumentation
With Rails 7.1, we can subscribe to ActiveRecord transaction events for instrumentation with the help of transaction.active_record.Rails 7.1 Disallow Foreign Keys Option
With Rails 7.1, we can disable foreign key constraints for the entire application by adding foreign_keys false option to database.ymlRails 7.1 Readonly Attribute Error
Rails 7.1 now raises an ActiveRecord::ReadonlyAttributeError on assignment to readonly attributes.Rails 7.1 Multiple Mailer Preview Paths
Rails 7.1 adds support for multiple mailer preview paths, enhancing flexibility and organization by allowing previews across various directories.Rails 7.1 Logs Job Enqueue Callers
Rails 7.1 ActiveJob logs background job enqueue callers with backtraces, showing the file and line number where jobs are triggered.Rails Ignore Counter Cache on Backfill
With Rails 7.2, we can now ignore counter cache columns during backfilling, allowing faster execution by reducing N+1 queries from counter cache column updates.Rails 7.1 Composite Key Batch Ordering
Rails 7.1 adds multi-column ordering support for composite primary keys in find_each, find_in_batches, and in_batches methods.Rails 7.1 *_deliver Mailer Callbacks
With Rails 7.1, we can hook into the lifecycle of email delivery with the help of ActionMailer before_deliver, around_deliver and after_deliver callbacks.Rails Warns On Tests Without Assertions.
With Rails 7.2, `ActiveSupport::TestCase` now warns when tests do not run any assertions.Rails 7.2 Adds Support For Devcontainer.
In Rails 7.2, use `--devcontainer` flag with `rails new` to add a devcontainer to new apps and run `bin/rails devcontainer` for existing apps.Functional Programming In React
Learn how React implements functional programming with immutable data, pure functions, and composition.CSS Units Guide - rem, em, px, vh, vw Explained
Master CSS units like rem, em, px, vh, vw, and percentage. Learn when to use absolute vs relative units for responsive web design.Controlled vs Uncontrolled Components in React
Learn the key differences between controlled and uncontrolled components in React and when to use each.Rails SKIP_TEST_DATABASE_TRUNCATE Flag
Rails 7.2 adds SKIP_TEST_DATABASE_TRUNCATE flag to speed up multi-process test runs by skipping table truncations on large databases.Puma-dev: Run Multiple Rails Apps Locally
Use puma-dev to run multiple Rails apps with custom .test domains and HTTPS locally.Rails after_all_transactions_commit Callback
Rails 7.2 adds after_all_transactions_commit to safely run actions like job enqueuing only after all transactions are committed.Rails with_connection for DB Optimization
Rails 7.2 adds with_connection to lease database connections only for a block's duration, improving concurrency for IO-heavy apps.Ruby 3.4 Keyword Args in Index SyntaxError
Passing keyword arguments in index to an array set methods throws SyntaxError.Rails 7.2 order Supports Hash Values
With Rails 7.2, ActiveRecord::Relation#order supports hash values where keys are table name, value is a hash of key (column name) and value (order direction).Rails 7.2 PG Adapter Date Type Casting
Rails 7.2 adds a Date decoder to the PostgreSQL adapter to type cast date columns to Ruby Date.Ruby 3.4 Block in Index SyntaxError
Passing a block as an argument in index to an array throws SyntaxError in Ruby 3.4 as it is no longer allowed.Rails 7.2 n_plus_one_only Strict Loading
In Rails 7.2, with strict loading in :n_plus_one_only mode, associations are eagerly loaded and child associations are lazy loaded.Ruby 3.4 Range#size TypeError Fix
Range#size raises TypeError if the begin value of Range is a Float or Rational or Beginless.Ruby 3.4 **nil No Longer Raises TypeError
When double splat ** operator used with nil, it is treated similarly to **{}, which passes no keywords and does not call any conversion methods.Rails validate_foreign_key for Data Integrity
validate_foreign_key validates foreign key constraint and is designed to reduce the impact of adding foreign keys on high-traffic tables in PostgreSQL.Rails 7.2 GitHub CI Workflow by Default
All new applications using Rails 7.2 will have GitHub CI workflow by default.Rails 7.1 explain Accepts Options
Adding analyze and verbose as ActiveRecord::Relation#explain options give us deeper insight into query performance.Rails 7.1 ActiveRecord regroup Method
With regroup and regroup! methods we can override the group_valuesRails 7.1 allows resetting singular
Query database again to retrieve the associated record by resetting the cache on singular associations.Rails 7.1 Disable Enum Auto-Methods
Disable auto generated methods of ActiveRecord.enum with instance_methods by passing false to it.Rails 7.1 path_params for url_for
path_params allows specified params to be used exclusively for named segments under scoped routing without unnecessarily appending parameters to every URL.Ruby 3.3 Range#reverse_each Improvements
Range#reverse_each can now process beginless ranges with an Integer endpoint and raises TypeError for endless ranges.Fly Postgres Backup to S3 via GitHub Actions
Discover how GitHub Actions empowers automation to effortlessly backup Fly.io hosted postgres databases, saving backups to a designated S3 bucket.Rails 7.1 reselect Accepts Hash Values
Use 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? method
Compare two ranges and see if they overlap each other. overlap? returns true if two ranges overlap each other, otherwise false.Rails 7.1 Default Dockerfile for Production
Rails 7.1 generates Dockerfile, .dockerignore, and docker-entrypoint for easy production deployment.Rails 7.1 perform_all_later for Jobs
perform_all_later allows us to enqueue multiple jobs that belong to different classes simultaneously within ActiveJob.Rails 7.1 Async Query Support in ActiveRecord
With the Active Record API for general async queries we can efficiently query not so fast queries asynchronously to improve the performance.Rails 7.1 generates_token_for Method
Generate tokens for specific purposes and verify their authenticity.Rails 7.1 ActiveRecord Normalization
Rails 7.1 lets you define custom normalization rules for model attributes with the normalizes method.Rails 7.1 Autoload Lib with Ignore Option
Autoloading lib directory isn't always straightforward. In this blog post, we'll delve into the autoloading of the lib directory using config.Rails Object#with for Attribute Management
We 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 restoringReact state management - useReducer vs Redux
This blog explores useReducer vs Redux, delving into their definitions, use cases, code samples and when to choose each for efficient state management.Rails Object#in? Now Supports Open Ranges
We can use Object#in? method to check open date ranges i.e. beginless and endless ranges.Speed Up Rails with CloudFront CDN
Learn how to integrate Amazon CloudFront CDN with your Rails app to serve static assets faster and reduce load times significantly.When to extract code to React custom hooks?
React custom hooks help us to build reusable logic, and make the code more readable.Rails Ignore Tables in Schema Dumps
Ignore tables by configuring regular expressions on ActiveRecord::SchemaDumper.Rails Routes Prefixed with cable
Rails improved its support for routes which helps us to navigate to routes prefixed with word cable which were throwing 404 errors before.