Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create a subquery in Rails using Active Record
query = select(:author, :created_at)
where("created_at >= ?", - 6.months)
.order(created_at: :desc)
).order(author: :asc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.