Sort Rails Models By Association Order
Sort your Rails models by the order of their belongs_to associations using ActiveRecord::Reflection.Customizing Rails Generators with Thor
Templates are an easy way to customize your Rails generators to fix repetitive tasks and make your life easier.Rails 7.1 Introduces Default Health Check
Rails 7.1 now introduces a default health check endpoint for health checks.Rails Inflections Initializer Guide
Rails comes with a lot of initializers. In this post, we will look at the inflections.rb initializer and how we can use it.Rails 7.1 db:prepare Loads Schema
Rails 7.1 introduces a new feature to allow db:prepare to load schema if the database already exists but is empty.Rails Opt Out of SameSite Cookie
Rails 7.1 introduces a new feature to allow opting out of the SameSite cookie attribute when setting a cookie.Rails Parameters.to_h Accepts Block
ActionController::Parameters.to_h will now receive a block just like Hash#to_h and achieve parity.Guide to Gemfile and Gemfile.lock
An in-depth overview of what a Gemfile is, how it works, and its role in managing Ruby dependenciesRails adds --js alias to --javascript
Rails now provides support to choose a javascript approach using --js aliasRails Pattern Matching for ActiveModel
Rails now provides pattern matching support for ActiveModel (and transitively ActiveRecord)Rails 7 Adds structurally_compatible?
Rails 7 adds structurally_compatible? to check if two relations can be combined with or/and queries.Rails 7 Optimizes remove_columns
Rails 7 optimizes remove_columns to generate a single SQL statement for dropping multiple columns on MySQL and PostgreSQL.Rails 7 Nested Locales in Engines
Rails 7 allows loading nested locales inside the `/locales` directory by default for better organization in larger apps.Rails 7 Generators Validate Attributes
Rails 7 generators will validate the type by checking if it is of a default migration type and will raise an error if it is invalid.Ruby 3.1 Adds Enumerable#compact
Ruby 3.1 adds Enumerable#compact and Enumerator::Lazy#compact to return a copy of `self` with all `nil` elements removed.Rails 7 Adds Enumerable max/min Methods
Rails 7 adds `Enumerable#maximum` and `Enumerable#minimum` to calculate the maximum or minimum from extracted elements of an enumerable.