{"pull_request":{"state":"open","merged_by":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/37ea77f171e46e55f99a99067dfd13cd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"37ea77f171e46e55f99a99067dfd13cd","url":"https://api.github.com/users/aimerickdesdoit","login":"aimerickdesdoit","id":1017165},"deletions":0,"updated_at":"2011-10-28T14:02:12Z","base":{"ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/83a9c9496491ad52f6d6b0be9ae4fb3e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"83a9c9496491ad52f6d6b0be9ae4fb3e","url":"https://api.github.com/users/jstorimer","login":"jstorimer","id":27818},"repo":{"name":"delayed_paperclip","master_branch":null,"pushed_at":"2011-10-28T14:02:12Z","fork":false,"homepage":"http://www.jstorimer.com/ruby/2010/01/30/delayed-paperclip.html","open_issues":8,"clone_url":"https://github.com/jstorimer/delayed_paperclip.git","updated_at":"2011-10-28T14:02:12Z","svn_url":"https://svn.github.com/jstorimer/delayed_paperclip","private":false,"forks":48,"language":"Ruby","url":"https://api.github.com/repos/jstorimer/delayed_paperclip","owner":{"avatar_url":"https://secure.gravatar.com/avatar/83a9c9496491ad52f6d6b0be9ae4fb3e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"83a9c9496491ad52f6d6b0be9ae4fb3e","url":"https://api.github.com/users/jstorimer","login":"jstorimer","id":27818},"html_url":"https://github.com/jstorimer/delayed_paperclip","description":"Process your Paperclip attachments in the background with delayed_job or Resque.","size":188,"id":489070,"watchers":340,"git_url":"git://github.com/jstorimer/delayed_paperclip.git","created_at":"2010-01-26T11:06:58Z","ssh_url":"git@github.com:jstorimer/delayed_paperclip.git"},"label":"jstorimer:master","sha":"d7587209910642936b8381094f4c706d0ad59bac"},"closed_at":null,"comments":0,"commits":1,"diff_url":"https://github.com/jstorimer/delayed_paperclip/pull/45.diff","head":{"ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/37ea77f171e46e55f99a99067dfd13cd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"37ea77f171e46e55f99a99067dfd13cd","url":"https://api.github.com/users/aimerickdesdoit","login":"aimerickdesdoit","id":1017165},"repo":{"name":"ruby-delayed-paperclip","master_branch":null,"pushed_at":"2011-10-12T14:22:36Z","fork":true,"homepage":"http://www.jstorimer.com/ruby/2010/01/30/delayed-paperclip.html","open_issues":0,"clone_url":"https://github.com/aimerickdesdoit/ruby-delayed-paperclip.git","updated_at":"2011-10-12T14:22:41Z","svn_url":"https://svn.github.com/aimerickdesdoit/ruby-delayed-paperclip","private":false,"forks":0,"language":"Ruby","url":"https://api.github.com/repos/aimerickdesdoit/ruby-delayed-paperclip","owner":{"avatar_url":"https://secure.gravatar.com/avatar/37ea77f171e46e55f99a99067dfd13cd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"37ea77f171e46e55f99a99067dfd13cd","url":"https://api.github.com/users/aimerickdesdoit","login":"aimerickdesdoit","id":1017165},"html_url":"https://github.com/aimerickdesdoit/ruby-delayed-paperclip","description":"Process your Paperclip attachments in the background with delayed_job or Resque.","size":112,"id":2560780,"watchers":1,"git_url":"git://github.com/aimerickdesdoit/ruby-delayed-paperclip.git","created_at":"2011-10-12T06:57:36Z","ssh_url":"git@github.com:aimerickdesdoit/ruby-delayed-paperclip.git"},"label":"aimerickdesdoit:master","sha":"42e1d5ea74f2b4da6db3603b0a7ee1ea0de8992e"},"url":"https://api.github.com/repos/jstorimer/delayed_paperclip/pulls/45","additions":22,"merged":false,"body":"when an attachment is not generated yet, paperclip use normal url\r\nin fact paperclip use \"original_filename\" to choose between \"url\" and \"default_url\" ; if \"original_filename\" is not null and resque don't unqueue yet there is a 404 error on image request\r\n\r\nso I overrode a method in Paperclip::Attachment\r\n\r\nmodule Paperclip\r\n  \r\n  class Attachment\r\n    \r\n    def url(style_name = default_style, use_timestamp = @use_timestamp)\r\n      default_url = @default_url.is_a?(Proc) ? @default_url.call(self) : @default_url\r\n      # paperclip original line : url = original_filename.nil? ? interpolate(default_url, style_name) : interpolate(@url, style_name)\r\n      url = exists?(style_name) ? interpolate(@url, style_name) : interpolate(default_url, style_name)\r\n      use_timestamp && updated_at ? [url, updated_at].compact.join(url.include?(\"?\") ? \"&\" : \"?\") : url\r\n    end\r\n    \r\n  end\r\n  \r\nend\r\n\r\nto make easier default_url management I had a new interpolation in Paperclip url generation which return size for fake image services like dummyimage.com\r\n\r\nmodule Paperclip\r\n\r\n  module Interpolations\r\n\r\n    def size(attachment, style_name)\r\n      return attachment.styles[style_name].geometry.to_s.gsub(/[^0-9x]/, '\\\\1').gsub(/^[x]+|[x]+$/, '')\r\n    end\r\n    \r\n  end\r\n  \r\nend","merged_at":null,"html_url":"https://github.com/jstorimer/delayed_paperclip/pull/45","issue_url":"https://github.com/jstorimer/delayed_paperclip/issues/45","_links":{"comments":{"_href":"https://api.github.com/repos/jstorimer/delayed_paperclip/issues/45/comments"},"html":{"_href":"https://github.com/jstorimer/delayed_paperclip/pull/45"},"review_comments":{"_href":"https://api.github.com/repos/jstorimer/delayed_paperclip/pulls/45/comments"},"self":{"_href":"https://api.github.com/repos/jstorimer/delayed_paperclip/pulls/45"}},"review_comments":0,"number":45,"title":"default_url and fake image service","mergeable":null,"changed_files":2,"id":442835,"patch_url":"https://github.com/jstorimer/delayed_paperclip/pull/45.patch","created_at":"2011-10-28T14:02:12Z"},"action":"opened","number":45}