Skip to content

Add destroy and destroy_all to Perron::Resource#195

Open
eelcoj wants to merge 1 commit into
mainfrom
destroy-all-the-things
Open

Add destroy and destroy_all to Perron::Resource#195
eelcoj wants to merge 1 commit into
mainfrom
destroy-all-the-things

Conversation

@eelcoj
Copy link
Copy Markdown
Contributor

@eelcoj eelcoj commented May 19, 2026

Adds destroy and destroy_all methods for deleting resource content files.

Content::Post.find("slug").destroy  # => deletes app/content/posts/slug.md
Content::Post.destroy_all  # => deletes app/content/posts/*.md

To me this is mostly syntactic sugar similar to how Active Record's destroy works (so you do not need to use SQL to delete a table row).

Niche or does it has some good use cases?

Adds destroy and destroy_all methods for deleting resource content files.

```bash
Content::Post.find("slug").destroy  # => deletes app/content/posts/slug.md
Content::Post.destroy_all  # => deletes app/content/posts/*.md
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant