<% @post.each do |post| %>
<%= PostCategory.select('name').where(id: post.post_category_id) %>
<% end %>
SELECT name FROM `post_categories` WHERE id = 1
#<PostCategory::ActiveRecord_Relation:0x00000006c62ba8>
# В контроллере:
@posts = Post.includes(:post_category)
# Во вьюхе:
<% @posts.each do |post| %>
<%= post.post_category.name %>
<% end %>