Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase.
Action Cable: Allow setting nil as subscription connection identifier for Redis
If you use Google Cloud Memorystore or another platform that blocks the command CLIENT SETNAME
in Redis, previously you needed to overwrite the Redis connection factory. With this change, you can set the id
of the connection to nil
in the configuration.
Improve leap years counting performance in distance_of_time_in_words
Before this change, the distance_of_time_in_words
method could’ve lead to a denial of service if the given from_time
and to_time
arguments are far apart. This pull request replaced the concerning code with a constant calculation.
Allow to configure maximum cache key sizes
This pull request adds the possibility to configure the maximum size for cache
keys. When the key exceeds the configured limit (250 bytes by default), it will be truncated and the digest of the rest of the key appended to it.
Note that previously ActiveSupport::Cache::RedisCacheStore
allowed up to 1kb cache keys before truncation, which is now reduced to 250 bytes.
This is how you can set it:
config.cache_store = :redis_cache_store, { max_key_size: 64 }
Use TRUE
and FALSE
for booleans in SQLite
SQLite 3.23.0 added support for TRUE and FALSE as aliases for 1/0 (similar to MySQL). Another pull request bumped the minimum required SQLite version in Active Record to 3.23.0, and this one updates the boolean query generation for SQLite to use TRUE and FALSE.
You can view the whole list of changes here. We had 12 contributors to the Rails codebase this past week!
Until next time!
Subscribe to get these updates mailed to you.