Repository navigation
Conversation
…::Base and API include The lists missed the ClassMethods of Redirecting, Renderers, Rescue, and the concerns included through other concerns (AbstractController::UrlFor, ActiveSupport::Callbacks, ActionView::Rendering and ViewPaths), so controllers had no use_renderers, allowed_redirect_hosts=, define_callbacks, or prepend_view_path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…asses include ActiveSupport::Concern extends a class with the ClassMethods of the concerns it includes, directly or through other concerns. The generated RBS didn't say so, so ActionController::TestCase had no tests, ActionDispatch::IntegrationTest no register_encoder or with_routing, ActionDispatch::Request no parameter_parsers=, and so on. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…asses include ActiveSupport::Concern extends a class with the ClassMethods of the concerns it includes, directly or through other concerns. The generated RBS didn't say so. ActionView::Base had no full_sanitizer or sanitizer_vendor, and ActionView::TestCase no tests or helper_method. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lasses include ActiveSupport::Concern extends a class with the ClassMethods of the concerns it includes, directly or through other concerns. The generated RBS didn't say so. ActiveModel::Type::Value had no serialize_cast_value_compatible?. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…classes include ActiveSupport::Concern extends a class with the ClassMethods of the concerns it includes, directly or through other concerns. The generated RBS didn't say so. For example, the connection adapters had no quote_column_name or define_callbacks, ActiveRecord::Schema no define, and PendingMigrationError no action. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… classes include ActiveSupport::Concern extends a class with the ClassMethods of the concerns it includes, directly or through other concerns. The generated RBS didn't say so. CurrentAttributes and ExecutionWrapper had no define_callbacks or set_callback. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t methods Configurable and Contexts define them in their included block and class_methods block, so they're methods of ActiveRecord::Encryption, which includes both. rbs prototype skips class_methods blocks, and the accessors from the included blocks were declared as singleton methods of Configurable and Contexts, so ActiveRecord::Encryption.config, configure, context, without_encryption, protecting_encrypted_data, and with_encryption_context weren't available. Regenerate with the bodies of `class_methods do ... end` as the concern's ClassMethods (also for EncryptableRecord, ColumnMethods, and ExtendedDeterministicQueries), with mattr/cattr accessors in an included block going to ClassMethods like class_attribute, and with ActiveRecord::Encryption extending the ClassMethods of the concerns it includes. EncryptableRecord's class_attribute now goes to its ClassMethods, so remove encrypted_attributes from the hand-written Base. Declare the context properties that Configurable delegates to the context, and type config and context. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@amatsuda Thanks for your contribution! Please follow the instructions below for each change. Available commandsYou can use the following commands by commenting on this PR.
|

Follow-up fixes for the Rails 8.1 signatures (#1084, #1086, #1087): class methods that classes get from the concerns they include, and
ActiveRecord::Encryption's configuration API.Class methods from concerns
ActiveSupport::Concernextends a class with theClassMethodsof the concerns it includes, directly or through other concerns. The RBS often didn't say so. The missing extends were computed with the RBS environment (concerns are modules thatextend ActiveSupport::Concern; a class is skipped when its superclass lacks the same ones) and added right after the class header. The rest of each generated file is unchanged.ActionController::BaseandAPI(hand-written, next to theirincludes):Redirecting,Renderers,Rescue,AbstractController::UrlFor,ActiveSupport::Callbacks,ActionView::RenderingandViewPaths. Controllers had nouse_renderers,allowed_redirect_hosts=,define_callbacks, orprepend_view_pathActionController::TestCase(tests),ActionDispatch::IntegrationTest(register_encoder,with_routing),ActionDispatch::Request(parameter_parsers=),ActionDispatch::CallbacksActionView::Base(full_sanitizer, ...),ActionView::TestCase(tests,helper_method),Tags::BaseActiveModel::Type::Value(serialize_cast_value_compatible?)quote_column_name,define_callbacks),Schema(define),PendingMigrationErrorandNoDatabaseError(action),Relation, column and type metadata classesCurrentAttributesandExecutionWrapper(define_callbacks,set_callback)ActiveRecord::Encryption
Encryption::ConfigurableandContextsdefine their API inincluded doandclass_methods doblocks, so the methods belong toActiveRecord::Encryption, which includes both.rbs prototypeskipsclass_methodsblocks, and the accessors from theincludedblocks were declared as singleton methods ofConfigurableandContexts. SoActiveRecord::Encryption.config,configure,context,with_encryption_context,without_encryption,protecting_encrypted_data, andon_encrypted_attribute_declaredweren't available.activerecord-generated.rbsis regenerated with:class_methods do ... endas the concern'sClassMethods(Configurable,Contexts,EncryptableRecord,ExtendedDeterministicQueries,ColumnMethods)mattr_*/cattr_*/thread_mattr_accessorinside anincludedblock going toClassMethods, likeclass_attributeActiveRecord::Encryptionextending theClassMethodsof the concerns it includesThe diff is limited to these. In the hand-written RBS,
encrypted_attributesis removed fromBase(it now comes fromEncryptableRecord::ClassMethods), the context properties thatConfigurabledelegates to the context (key_provider,encryptor, ...) are declared, andconfigandcontextreturnEncryption::ConfigandEncryption::Context.Tests
Each commit adds tests that fail without it, and
bin/testpasses for each changed gem.🤖 Generated with Claude Code