Skip to content
  • Alexandre Ruban's avatar
    6c2132b3
    Fix ActionText::Attachable#as_json · 6c2132b3
    Alexandre Ruban authored
    Before this commit, using ActionText and calling `#as_json` on a
    non-persisted `ActiveStorage::Blob` raised an error.
    
    This is because `ActionText::Attachable` is included in
    `ActiveStorage::Blob` and overrides the `#as_json` method to
    expose a global signed id. However, a global signed id can only
    be generated on a persisted instance.
    
    This commit fixes the issue by making sure the blob is persisted
    before exposing the global signed id.
    6c2132b3
    Fix ActionText::Attachable#as_json
    Alexandre Ruban authored
    Before this commit, using ActionText and calling `#as_json` on a
    non-persisted `ActiveStorage::Blob` raised an error.
    
    This is because `ActionText::Attachable` is included in
    `ActiveStorage::Blob` and overrides the `#as_json` method to
    expose a global signed id. However, a global signed id can only
    be generated on a persisted instance.
    
    This commit fixes the issue by making sure the blob is persisted
    before exposing the global signed id.
Loading