rails changelog


Here's the latest and greatest from our codebase! 🎉

New Features

  • Workflow for Testing Devcontainer Setup: We've rolled out a shiny new workflow for testing the generated devcontainer setup for new Rails apps. This workflow includes generating a new app with the --dev flag, initializing the dev container, creating a model scaffold, running migrations, and testing. It covers all four supported database configurations to ensure everything works smoothly. 🚀

Improvements

  • Relative Paths in AR Basics Guide: Updated the Active Record basics guide to use relative paths in code examples. This makes the guide more consistent and user-friendly, especially when using the copy button. 📚
  • ActionCable Redis Config Example: Improved the documentation for setting up the Redis server for ActionCable. The new example is clearer and more concise, making it easier for developers to follow. 📝
  • String Keys for SQLCommenter: SQLCommenter now supports string keys, giving you more flexibility and making it easier to customize and use in your projects. 🗝️
  • Rename MoneyType to PriceType: Renamed the MoneyType class to PriceType for better clarity and readability. 💸

Bugfixes

  • Fix query_logs_test.rb: Addressed an issue in the query_logs_test.rb file to ensure tests run correctly and reliably. 🛠️
  • Arel SQL Generation for UNION: Fixed generated SQL for UNION and UNION ALL involving LIMIT or ORDER BY by wrapping SELECT statements in parentheses. This ensures the SQL is generated correctly. 🧩
  • Respond with 406 for Blocked Browsers: Updated the server response to 406 Not Acceptable for browsers blocked by the allow_browser setting, aligning with RFC 9110 specifications. 🚫

Stay tuned for more updates and happy coding! ✨

Included Commits

2024-04-07T21:30:19 See commit

This commit improves the ActionCable redis configuration example by updating the documentation to provide a clearer and more concise explanation of how to set up the redis server for ActionCable. The changes aim to make it easier for developers to understand and implement the configuration for their projects. Additionally, the commit includes a skip ci tag to indicate that this change does not require continuous integration testing.

Overall, this commit enhances the usability of the ActionCable redis configuration example by improving the documentation and making it more user-friendly. The skip ci tag also helps streamline the development process by indicating that this change does not need to be tested in the continuous integration pipeline.

Files changed

2024-04-10T17:26:59 See commit

This commit updates the Active Record basics guide to use relative paths in code examples. Most other examples in the guide already follow this pattern, and using a relative filepath in the code block will now remove it when using the copy button. The changes include modifying the file active_record_basics.md, with 3 additions and 3 deletions, resulting in a total of 6 changes. The specific changes involve updating the filepath in a code block related to creating a migration for a books table, changing it from "/db/migrate/20240220143807_create_books.rb" to "db/migrate/20240220143807_create_books.rb".

Additionally, the commit includes a note about generating an Active Record model class and matching migration using the command "bin/rails generate model Book title:string author:string", which creates files in the app/models and db/migrate directories. By using relative paths in the code examples, the guide is now more consistent and user-friendly, making it easier for readers to follow and understand the instructions provided.

Files changed

  • guides/source/active_record_basics.md
2024-04-11T08:50:24 See commit

This commit updates the server response to block browsers that are not allowed by the allow_browser setting. Instead of sending a 426 response with an Upgrade header field as specified in RFC 9110, the server will now respond with a 406 Not Acceptable status code. This status code indicates that the resource does not have a current representation that would be acceptable to the user agent based on the proactive negotiation header fields received in the request. The proactive negotiation section of RFC 9110 mentions implicit characteristics such as the client's network address or parts of the User-Agent field.

Overall, this commit ensures that browsers blocked by the allow_browser setting will receive a more appropriate 406 Not Acceptable response, indicating that the resource is not currently acceptable based on the proactive negotiation header fields in the request. This aligns with the specifications outlined in RFC 9110 and provides a clearer indication to the user agent that the resource is not available for their browser.

Files changed

2024-04-11T14:27:04 See commit

This commit addresses an issue with the generated SQL for UNION and UNION ALL statements when they involve LIMIT or ORDER BY clauses. The fix involves wrapping the SELECT statements within the UNION or UNION ALL in parentheses to ensure that the SQL is generated correctly. This change ensures that the generated SQL for these statements will work as expected and produce the desired results when used in queries.

Files changed

2024-04-11T19:16:10 See commit

This commit renames the class MoneyType to PriceType, likely to better reflect the purpose and use of the class within the codebase. This change will help improve readability and maintainability of the code by using a more appropriate and descriptive name for the class. No other changes were made in this commit, indicating that it was a simple renaming refactoring task.

Files changed

2024-04-11T19:47:11 See commit

This commit allows for string keys to be used in SQLCommenter, expanding the flexibility and usability of the tool. Previously, only integer keys were accepted, but now users can input string keys as well. This change will make it easier for developers to customize and use SQLCommenter in their projects, as they can now use strings to identify and track specific comments within their SQL queries. Overall, this update enhances the functionality of SQLCommenter and makes it more user-friendly for a wider range of users.

Files changed

2024-04-11T23:36:14 See commit

This commit fixes an issue in the query_logs_test.rb file. The changes made in this commit address a specific problem within the test file, ensuring that the tests run correctly and accurately assess the functionality of the query logs. By fixing this issue, the overall reliability of the testing process is improved, allowing for more accurate and efficient testing of the query logs functionality.

Files changed

2024-04-12T14:28:51 See commit

This commit introduces a new workflow for testing the generated devcontainer setup for new Rails applications. The workflow includes steps such as generating a new app with the --dev flag, initializing the dev container, creating a model scaffold, running migrations, and running tests. It aims to ensure that the devcontainer setup works properly for each of the four supported database configurations. Overall, this workflow will help in verifying the functionality and compatibility of the devcontainer setup for Rails applications.

Files changed