-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 6.0.0.rc1 Missing Deprecation SourceAnnotationExtractor::Annotation #36313
Comments
@nvick This is how similar issue in rspec was fixed: https://github.com/rspec/rspec-rails/blob/f227983ba2ec8c666d073f40f5a5f517510bd058/lib/rspec-rails.rb#L13 But the fix is present in version 2 of haml-rails. This is not an Rails issue so closing it. |
@prathamesh-sonpatki This was caused by moving |
@nvick I went by the comments in #32065 and fixes made to other repos when similar issues were reported. But I will open it so others can weigh in. |
This is legit break. I still owe a fix to #32065 ... so I'm assigning myself again and will be working on this. |
@sikachu Are you still looking at this? If not, shall I pick up? |
Sorry about the delay, I just opened #36557 to address the issue. |
This commit fixes rails#36313. After rails#32065 moved `SourceAnnotationExtractor` into `Rails` module, it broke the ability to access `SourceAnnotationExtractor::Annotate` directly as user would get this error: TypeError: Rails::SourceAnnotationExtractor is not a class/module This commit fixes the issue by making `DeprecatedConstantProxy` to inherit from `Module` and then defines `method_missing` and `const_missing` to retain the previous functionality. Thank you Matthew Draper for the idea of how to fix the issue! [Prem Sichanugrist & Matthew Draper]
I discovered this issue while upgrading a small app that uses
haml_rails
which is usingSourceAnnotationExtractor::Annotation
in version 1.https://github.com/indirect/haml-rails/blob/86a48a59d7c31fcaacd35fdffa17551fb24e131c/lib/haml-rails.rb#L49
Here is the PR that introduced the changes #32065
Steps to reproduce
Expected behavior
I would expect both tests to pass with a Deprecation warning pointing to the updated module info.
Actual behavior
The main class SourceAnnotationExtractor has the warning, but ::Annotation outputs
TypeError: Rails::SourceAnnotationExtractor is not a class/module
System configuration
Rails version:
6.0.0.rc1
Ruby version:
2.6.2p47
The text was updated successfully, but these errors were encountered: