Reputation: 41999
I'm retrieving some records from a database using user = Users.all
in the console but they are very unreadable.
I know that Yaml will make it more legible but don't know how to convert the results to Yaml.
Upvotes: 2
Views: 6345
Reputation: 26507
If you want your output to be ready for Rails fixtures then restrict it to the attributes:
User.all.each {|u| y u.attributes}
Upvotes: 0
Reputation: 182
You can also just prepend a 'y' to your command in the console:
y User.all
To get yaml output.
Upvotes: 2