Skip to content

Add destroy and destroy_all to Perron::Resource#195

Merged
eelcoj merged 1 commit into
mainfrom
destroy-all-the-things
Jun 6, 2026
Merged

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

Conversation

@eelcoj

@eelcoj eelcoj commented May 19, 2026

Copy link
Copy Markdown
Contributor

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
```
@eelcoj eelcoj merged commit 09decb2 into main Jun 6, 2026
0 of 3 checks passed
@eelcoj eelcoj deleted the destroy-all-the-things branch June 6, 2026 09:53
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