Skip to content
This repository was archived by the owner on Oct 5, 2018. It is now read-only.
This repository was archived by the owner on Oct 5, 2018. It is now read-only.

default_url is being shown for styles not marked to be processed in background #107

Closed
@patrickbajao

Description

@patrickbajao

Hi,

I seem to be encountering a bug wherein the default_url is being returned for styles that I didn't mark to be process in background. I'm using the latest gem version (2.8.0).

Here's my paperclip setup:

has_attached_file :photo, {
  styles: {
    large: ['400x400#', :jpg],
    small: ['200x200#', :jpg]
  },
  path: "photos/items/:id/:style/:basename.:extension",
  default_url: "//localhost:3000/assets/items/missing/:style.jpg",
  only_process: [:large]
}

process_in_background :photo, only_process: [:small]

Then here's a test I run in my console to replicate this bug:

2.0.0-p353 :005 > i.photo = File.open("sample.jpg")
2.0.0-p353 :006 > i.save
2.0.0-p353 :007 > i.photo.url(:large)
 => "//localhost:3000/assets/items/missing/large.jpg"
2.0.0-p353 :008 > i.photo.url(:small)
 => "//localhost:3000/assets/items/missing/small.jpg"

I expect small to return the default url but I expect large to return the actual URL for the image since it was not processed in background. Even when I reload (using i.reload) the object, it's the same thing.

Looking at the commit history, it seems that it should be fixed by this commit. Though this issue I'm encountering doesn't seem to be covered by the test cases in that commit. So I'm not sure if this is a regression or something else.

Hope someone can shed a light on this issue. Thanks in advance! :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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