You can include the referenced metrics in one ActiveRecord statement by simply expanding the one you are already using:
@articles = Article.where(author_id: params[:id]).includes(:metrics).all
This loads the articles by the specified author and includes all metrics related to these articles in one go. You then have the objects in one tidy structure instead of having to juggle and map the articles to their metrics separately.
Access them like this (in ERB for example):
<% @articles.each do |article| %>
<%= article.title %>
<%= article.text %>
<% article.metrics.each do |metric| %>
<%= metric.value %>
<% end %>
<% end %>
The advantage here is that all relevant metrics are preloaded. If you simply call article.metrics
without previously loading them using the includes
method, your server would need to access the database every time you want to use the metrics of each article, slowing down the page loading times considerably.