ActionController::Base.log_at and more!

ActionController::Base.log_at and more!

Hi there, this is Greg, bringing you the changes in Rails from the past week. Let’s dive in!

Reduce stat(2) calls

This commit adds a slight performance improvement by reducing stat(2) calls in Rails.

Serialize symbols to strings in ImmutableString serialize method

This PR updates the immutable string class to serialize symbols to strings to mirror this behavior as ActiveModel::Attribute calls this serialize method to determine the return value for changed_in_place?. Prior to this change, this code would wrongly report that “something” had changed.

Add ActionController::Base.log_at

This PR makes it possible to set a different log level on a per request basis.

  # Use the debug level if a particular cookie is set.
class ApplicationController < ActionController::Base
log_at :debug, if: -> { cookies[:debug] }

25 people contributed to Rails last week, if you want to be part of that, check out the open issues on Github.
Until next time.

This Week in Rails · 30 N Racine #200 · Chicago IL 60607 · USA

                      	> [View in browser](