Abram
Abram

Reputation: 41914

View contents of ActiveRecord::Relation Object

I have produced an AR query which has returned an object of the above type. The object has the name of #<Review id: 26>

I am learning how to do advanced join queries and I would like to know if I have produced the desired object. It is a pain in the neck to have to assign the object to a variable and then slowly figure out how to iterate over it's contents using the data you hope is contained within.

Thank you.

Upvotes: 1

Views: 1956

Answers (1)

RajaRaviVarma
RajaRaviVarma

Reputation: 2742

Probably you are looking for variable_name.to_json.

Upvotes: 1

Related Questions