Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/rails_view_annotator/action_view/partial_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ def self.augment_partial_renderer klass
short_identifier = Pathname.new(identifier).relative_path_from Rails.root

r = /^#{Regexp.escape(Rails.root.to_s)}\/([^:]+:\d+)/
caller.find { |line| line.match r }
called_from = context = $1
called_from = context = nil
caller.each do |line|
m = line.match(r)
unless m.nil?
called_from = context = m[1]
break
end
end

descriptor = "#{short_identifier} (from #{called_from})"

Expand Down