A smart way to get data from AR is utilizing pluck() to extract the raw data.

For example, a range of YEAR (integers) from the first/last for your blog posts:

min, max = BlogPost.pluck(
  Arel.sql("MIN(EXTRACT(year from created_at)::integer), MAX(EXTRACT(year from created_at)::integer)")
).first