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] }
end

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
Unsubscribe

                      	> [View in browser](http://track.goodbits.io/f/a/Q4H4T0DZXLzBfJUcvFqrHA~~/AAB5kwA~/RgRfc3FvP0Q_aHR0cHM6Ly9nb29kYml0cy5pby9lbWFpbHMvZjI4YzU4MmUtNjI3Yi00ZTE0LWFhM2YtYTYxMWFiZmNhNTZjVwNzcGNCCgAjceyQXWuDoMNSGnJhaWxzLXdlZWtseUB6b2V0aGljYWwuY29tWAQAAAAA)