Hi, it’s zzak. Let’s explore this week’s changes in the Rails codebase.
The Rails Foundation launched a new podcast: ‘On Rails’ with host Robby Russell
In each episode, Robby talks with Rails devs and explores the real-world decisions that go into building, maintaining, and scaling Ruby on Rails applications. Episode one is already up with guest Rosa Gutiérrez. Listen at onrails.buzzsprout.com, or in your favorite podcast app.
Improve CurrentAttribute and ExecutionContext state management in test cases
Previously these two global state would be entirely cleared out whenever calling into code that is wrapped by the Rails executor, typically Action Controller or Active Job helpers. Now re-entering the executor will properly save and restore that state.
Previously these two global state would be entirely cleared out whenever calling into code that is wrapped by the Rails executor, typically Action Controller or Active Job helpers. Now re-entering the executor will properly save and restore that state.
Implement ActiveSupport::BacktraceCleaner#first_clean_frame
The new method ActiveSupport::BacktraceCleaner#first_clean_frame returns the first clean frame of the caller’s backtrace, or nil. Useful when you want to report the application-level frame where something happened, for example the caller that emitted a warning you are tracking in production.
The new method ActiveSupport::BacktraceCleaner#first_clean_frame returns the first clean frame of the caller’s backtrace, or nil. Useful when you want to report the application-level frame where something happened, for example the caller that emitted a warning you are tracking in production.
Implement ActiveSupport::BacktraceCleaner#first_clean_location
The new method ActiveSupport::BacktraceCleaner#first_clean_location returns the first clean location of the caller’s call stack, or nil. Locations are Thread::Backtrace::Location objects. Useful when you want to report the application-level location where something happened, for example the source file and line number of a warning you are tracking in production.
Respect users configured IRB_NAME
Rails will now honor when the user has configured IRB.conf[:IRB_NAME]. This PR makes it so the IRB_NAME is only set if it is not the default, similar to the way the PROMPT_MODE is set.
Rails will now honor when the user has configured IRB.conf[:IRB_NAME]. This PR makes it so the IRB_NAME is only set if it is not the default, similar to the way the PROMPT_MODE is set.
Active Job Continuation isolated steps
Add an isolated option to steps. Defaults to false. Isolated steps are always run in their own job execution. This allows you to execute a long running step separately which is useful to ensure that progress is saved before it runs.
Add an isolated option to steps. Defaults to false. Isolated steps are always run in their own job execution. This allows you to execute a long running step separately which is useful to ensure that progress is saved before it runs.
Use ntuples to populate row_count instead of count for Postgres
Now row_count in the sql.active_record notification will use PG::Result#ntuples, a libpq function for getting the number of rows returned from a query, rather than #count which would iterate through the entire result set.
Fix checking unpersisted record is included in strict HABTM association
Previously, trying to check whether a new_record? (Post.new) is include?d in a strict-loaded has_and_belongs_to_many association would raise a StrictLoadingViolationError even when the HABTM association is already loaded.
Previously, trying to check whether a new_record? (Post.new) is include?d in a strict-loaded has_and_belongs_to_many association would raise a StrictLoadingViolationError even when the HABTM association is already loaded.
FileUpdateChecker and EventedFileUpdateChecker ignore changes in Gem.path now
This should improve the performance of reloads in development on an app with many gems.
You can view the whole list of changes here. We had 24 contributors to the Rails codebase this past week!
Until next time!