I have to fetch the records from the database and after some validations i have to remove the record from the object if the custom validation get failed.
@posts = Post.all
After doing some business logic validation i don’t want to keep post with id 1 only in the @posts object How can i remove that post from the @posts object only not from the database.
You can use the select method: