Skip to content

save_draft returns false on models having activestorage attachments #83

@ahharvey

Description

@ahharvey

I'm not sure whether this bug lies within Draftsman or my app, and I'm having trouble getting useful information to investigate further.

I'm posting here to check whether anyone else can replicate this.

A very simple test case:

# model
class User 
    has_drafts
    has_one_attached :avatar
end

# console

> u = User.last
> u.name = "New Name"
> u.save_draft
=> false

# 'u' has no errors
> u.errors.messages
=> {}

# if 'has_one_attached :avatar' is commented out a draft is created as expected
> u.save_draft
=> true
  1. Why would activestorage prevent Draftsman from saving drafts?
  2. What is the best way to inspect the save_draft method and find out what is causing it to fail?

I have also posted a question on SO https://stackoverflow.com/questions/54106001/why-does-draftsman-save-draft-return-false-when-the-model-has-activestorage-atta

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