Skip to content

Rails 6.0.0.rc1 Missing Deprecation SourceAnnotationExtractor::Annotation #36313

@natevick

Description

@natevick

I discovered this issue while upgrading a small app that uses haml_rails which is using SourceAnnotationExtractor::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

# frozen_string_literal: true

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  git_source(:github) { |repo| "https://github.com/#{repo}.git" }

  # Activate the gem you are reporting the issue against.
  gem 'rails', '6.0.0.rc1'
end

require "active_support"
require "active_support/core_ext/object/blank"
require "rails/source_annotation_extractor"
require "minitest/autorun"

def extractor
  SourceAnnotationExtractor
end

def annotation
  SourceAnnotationExtractor::Annotation
end

class SourceAnnotationExtractorTest < ActiveSupport::TestCase
  test 'test_stuff' do
    assert_not_nil extractor
  end
  test 'more_stuff' do
    assert_not_nil annotation
  end
end

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions