I want to use a grep-like function in pry console in rails. For example, when I have a model like this:
pry(main)> show-model Post
Company
id: integer
title: string
author: string
content: text
created_at: datetime
updated_at: datetime
I want to filter the output like:
pry(main)> show-model Post --grep "string"
title: string
author: string
or
pry(main)> show-model Post --grep "content"
content: text
It seems there is a --grep
option for ls
command in pry. I couldn't find a similar function with show-model
command. Is there a way to do it?