File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
lib/active_support/deprecation Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ def _extract_callstack(callstack)
172
172
LIB_DIR = RbConfig ::CONFIG [ "libdir" ]
173
173
174
174
def ignored_callstack? ( path )
175
- path . start_with? ( RAILS_GEM_ROOT , LIB_DIR )
175
+ path . start_with? ( RAILS_GEM_ROOT , LIB_DIR ) || path . include? ( "<internal:" )
176
176
end
177
177
end
178
178
end
Original file line number Diff line number Diff line change @@ -975,11 +975,22 @@ def generated_method_that_call_deprecation(deprecator)
975
975
end
976
976
end
977
977
978
+ test "warn deprecation can blame code from internal methods" do
979
+ @deprecator . behavior = -> ( message , *) { @message = message }
980
+ method_that_emits_deprecation_with_internal_method ( @deprecator )
981
+
982
+ assert_not_includes ( @message , "internal" )
983
+ end
984
+
978
985
private
979
986
def method_that_emits_deprecation ( deprecator )
980
987
deprecator . warn
981
988
end
982
989
990
+ def method_that_emits_deprecation_with_internal_method ( deprecator )
991
+ [ 1 ] . each { deprecator . warn }
992
+ end
993
+
983
994
def with_rails_application_deprecators ( &block )
984
995
application = Struct . new ( :deprecators ) . new ( ActiveSupport ::Deprecation ::Deprecators . new )
985
996
rails = Struct . new ( :application ) . new ( application )
You can’t perform that action at this time.
0 commit comments