First iteration of Active Record?

I just came across a question on Stack Overflow on how to figure out on which iteration you are in a Ruby loop. The accepted solution given by a user called Detunized was as follows:

my_array.each_with_index do |item, index|
    if index == 0
        # do something with the first item
    end
end

Since this question was asked, I'm sure somebody would want to do something similar on an Active Record object. I Googled but couldn't find anything relevant. So, how do you find out if you're on the first item of a loop/each on an Active Record object?

Since it's an object and not an array, you can't access the index in the same way as with an array. What you could do is the following:

@users = User.all
@users.each do |user|
    first_item = (user.id == @users[0].id) ? true : false
end