rails changelog


Here's a rundown of the latest updates, packed with improvements and bug fixes to make your experience smoother and more efficient! 🚀

  • New feature: Configurable Maximum Cache Key Sizes
    Say goodbye to the rigid 1024-byte limit! You can now configure maximum cache key sizes in the RedisCacheStore class. Whether you want to set a specific max_key_size or disable the size limit entirely, the choice is yours. This change comes with new tests to ensure everything works like a charm. Flexibility for the win! 🎉

  • Improvement: Raw Data Handling in RedisCacheStore
    Now you can store and retrieve data in its original format without serialization by using the raw: true option. This tweak to the RedisCacheStore configuration enhances flexibility for developers working with raw data. Plus, there's a new test case to confirm everything functions as expected. Raw power unleashed! ⚙️

  • Improvement: Speedy Leap Year Calculations
    We've turbocharged the leap year calculations in distance_of_time_in_words. This optimization reduces computational overhead and speeds up time calculations, especially for longer time spans. Faster execution times and reliable results—what's not to love? ⏱️

  • Bugfix: Owner Persistence Check in find_or_create_by!
    Fixed an issue with the find_or_create_by! method not checking owner persistence correctly. Now, a flag tracks the success of the last transaction, ensuring consistent persistence checks. No more misleading results—just solid reliability! 🛠️

  • Bugfix: Dropdown Menu Malfunction
    We've squashed the bug that was preventing dropdown menus from opening. By removing unnecessary JavaScript and fixing a div tag, the dropdowns are back and better than ever. Smooth sailing ahead! 🎈

  • Bugfix: Instance Variable Name Typo
    A tiny typo in an instance variable name has been corrected for improved code clarity. It's the little things that make a big difference! 🔍

  • Chore: Added Changelog for #54907
    A new changelog entry keeps everything transparent and well-documented. Plus, with the [ci skip] directive, we keep the process efficient and streamlined. 📜

Enjoy these updates and keep building awesome stuff! 🌟

Included Commits

2025-04-11T20:52:52 See commit

The commit adds a changelog entry for issue #54907, ensuring that relevant updates and modifications are documented for future reference. The inclusion of this changelog aims to improve transparency and maintainability within the project by clearly outlining the changes made.

Additionally, the commit includes a [ci skip] directive, indicating that this change does not require a continuous integration build to be triggered, streamlining the development process.

Files changed

2025-04-13T11:48:45 See commit

This commit introduces the ability to configure maximum cache key sizes in the RedisCacheStore class of the Active Support library. Previously, cache keys were truncated to a maximum size of 1024 bytes, but this limit has been removed in favor of a configurable option. The implementation allows users to set a max_key_size when initializing the cache store, enabling more flexibility in managing key sizes. If a key exceeds the specified maximum size, it will not be truncated, and users can disable the size limit by setting max_key_size to false.

Additionally, the commit includes new tests to verify the functionality of the maximum key size configuration. These tests ensure that when a maximum key size is set, keys that exceed this limit are handled appropriately, while also confirming that disabling the limit allows for larger keys to be stored and retrieved without issues. Overall, this change enhances the configurability of the Redis cache store, providing developers with more control over their caching strategy.

Files changed

  • activesupport/lib/active_support/cache/redis_cache_store.rb
  • activesupport/test/cache/behaviors/cache_store_behavior.rb
2025-04-13T16:48:11 See commit

This commit addresses the configuration of the RedisCacheStore by adding support for the raw option, which allows users to store and retrieve data in its original format without serialization. The modification was made in the active_support/cache.rb file, where the :raw option was added to the list of recognized cache options. This enhancement ensures that when the raw option is set to true, the cache can handle data as-is, improving flexibility for developers who need to work with raw data.

Additionally, the commit includes a new test case in the cache_store_behavior.rb file to verify that the raw configuration works correctly. In the test, a cache instance is created with the raw option enabled, and it checks that writing and reading a value ("foo" and "bar") behaves as expected. This addition not only confirms the functionality of the new option but also helps ensure the reliability of the caching mechanism within the ActiveSupport library.

Files changed

  • activesupport/lib/active_support/cache.rb
  • activesupport/test/cache/behaviors/cache_store_behavior.rb
2025-04-14T16:21:28 See commit

This commit addresses an issue with the find_or_create_by! method in Active Record, specifically regarding its handling of owner persistence in associations. The problem arose when a previous modification changed the behavior of Record#create and Record#new followed by Record#save, leading to inconsistent checks on whether the owner (e.g., a Car object) was persisted before creating associated records (e.g., wheels). The commit highlights that while car.wheels.create correctly checks for persistence, wheel.save does not, which can lead to misleading results in transactions.

To resolve this, the commit introduces a flag on the record to track the success of the last transaction. This change is crucial because it allows developers to accurately determine the state of the record after a nested transaction, addressing the documentation's oversight regarding how to handle transaction rollbacks effectively. By implementing this solution, the commit ensures that the persistence checks are consistent across different methods of record creation and saves, ultimately improving the reliability of the Active Record library.

Files changed

2025-04-14T19:31:34 See commit

The recent commit enhances the performance of leap year calculations within the distance_of_time_in_words function. By optimizing the algorithm used for counting leap years, the update aims to reduce computational overhead and improve the overall efficiency of time calculations, particularly in scenarios involving longer time spans.

These improvements are expected to lead to faster execution times for applications that rely on accurate time distance calculations. This optimization not only enhances performance but also contributes to the reliability of the function, ensuring that it accurately reflects time differences across varying calendar years.

Files changed

2025-04-15T03:41:35 See commit

This commit addresses a typo in an instance variable name within the ActiveRecord library, specifically in the transactions.rb file. The change involves renaming the variable from @_last_transaction_status to @_last_transaction_return_status to better reflect its purpose and improve code clarity.

The modification includes one addition and one deletion, resulting in a total of two changes within the init_internals method. This adjustment enhances the readability of the code and ensures that the variable name accurately describes its function related to transaction status tracking.

Files changed

  • activerecord/lib/active_record/transactions.rb
2025-04-17T05:57:33 See commit

This commit addresses an issue with a dropdown menu that was not functioning properly, ensuring that it opens as intended. The update involves the removal of potentially unnecessary JavaScript code, which may have contributed to the dropdown's malfunction. Additionally, it includes a correction in the index file by properly closing a div tag, which could have impacted the overall layout and functionality of the dropdown.

Overall, these changes enhance the code's efficiency and resolve the dropdown issue, leading to improved user experience and cleaner code structure.

Files changed