Skip to content

Deprecation of ActionView's time_ago_in_words

What does this MR do?

Replaces ActionView's time_ago_in_words with GitLab's homemade time_ago_with_tooltip as possible.

Are there points in the code the reviewer needs to double check?

How can we warn developers it when they add time_ago_in_words?

Note: there are still four occurrences of time_ago_in_words:

$ git grep -n time_ago_in_words -- app
app/helpers/milestones_helper.rb:124:      time_ago = time_ago_in_words(date)
app/helpers/runners_helper.rb:13:                  title: "Runner is #{status}, last contact was #{time_ago_in_words(runner.contacted_at)} ago"
app/serializers/entity_date_helper.rb:8:    distance_of_time_in_words(Time.now, diff, scope: 'datetime.time_ago_in_words')
app/serializers/entity_date_helper.rb:52:      time_ago = time_ago_in_words(entity.due_date)

Why was this MR needed?

This can improve performance as time_ago_in_words prevents caching components.

Screenshots (if relevant)

Too many to show here.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #45761 (closed)

Edited by Takuya Noguchi

Merge request reports