Updated acts_as_* helpers to use canonical 'rails-style' foreign keys #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the acts_as_message, acts_as_chat and acts_as_tool class methods to use Rails-style foreign keys whenever custom class names are used as options. For example:
will now set the foreign key on the
belongs_to :chat
association to befoo_chat_id
, instead ofchat_id
, and will set the foreign key onbelongs_to :parent_tool_call
association tofoo_tool_call_id
instead of justtool_call_id
.This is consistent with Rails' naming conventions for class names and foreign keys. Changes are backwards-compatible with existing code/behavior, and don't require a major or minor version bump.
Updated test cases to ensure that the associations are working, but didn't re-record VCR tests, since I don't have an OpenAPI key.
Closes #150