Skip to content

Improve documentation for use with associations #84

@SirRawlins

Description

@SirRawlins

Great gem folks 👍

However, I'm struggling a little to see how to work this with draft associations, and I think it's something which could perhaps be covered in the documentation?

Let's say I have a draftable blog post, and a post can have various tags associated with it.

class Post < ApplicationRecord
    has_drafts
    has_many :tags
end

class Tag < ApplicationRecord
    belongs_to :post
end

Drafting changes to the blog post in isolation is simple enough, I can change it's title, or correct some typos in it's content, that's working just lovely.

However, what if I want to change the tags associated with my blog post?. How can I make those association changes 'draft' rather than immediate?

How would model/controller code look in a scenario like that?

If someone can help me understand, I'm happy to wrap up a PR to improve the README around this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions