I have a Post
model with the column defined by the following migration:
add_column :posts, :comments, :jsonb, default: []
add_index :posts, :comments, using: :gin
I would like to know the query to run so that I have a count of all the Posts
which have the default, empty array as comments
.
Post.where("comments = '[]'").count