I have two variables that were being set to session tokens for testing purposes so my code was as follows:
@auth_token = Session.first.token
@auth2_token = Session.last.token
I now have the need for a third session token and I was wondering how I could go about this in the before statement. Can someone tell me how I could set the variable to the second record in the sessions table.
@auth_token = Session.first.token
@auth2_token = Session.limit(2).token
@auth3_token = Session.last.token
I have tried limit(2).token but it doesnt seem to be working
You’ve failed with
limit(2).tokenbecauselimitreturns 2 objects and you need to applytokenmethod to every of them.