Hi there. Andy here, with the first newsletter of 2021, highlighting some updates to Ruby on Rails over the last few weeks. Let’s jump right in!
Find and assert the presence of exactly one record
Add FinderMethods#sole and #find_sole_by to find and assert the presence of exactly one record.
Submit the same form with different HTTP methods
This change provides the ability to post the same form with different HTTP methods. For example PUT and a DELETE requests can be made from the same form.
Validate numericality with a Range
A Ruby range can now be provided as part of a numericality validator.
Improve Action Text extensibility
Allow the HTML surrounding rich text to be customized while retaining private control over how the rich text itself is rendered.
Change Action View helpers to always render a element.
Add stats to Redis Cache Store
Add a RedisCacheStore#stats method that is similar to MemCacheStore#stats.
Add option to disable the Link header
The option config.action_view.preload_links_header was added to allow disabling of the Link header when using stylesheet_link_tag and javascript_include_tag.
Fix: Respect getter overwrites in the model
ActiveRecord::AttributeMethods::Query will now respect the getter overrides defined in the model.
45 people contributed to Rails over the last several weeks. Check out the open issues to get involved and help out. Until next week!
This Week in Rails · 30 N Racine #200 · Chicago IL 60607 · USA
Unsubscribe | View in browser