{"issue":{"created_at":"2011-11-29T16:38:54Z","state":"open","updated_at":"2011-11-30T17:04:10Z","comments":3,"user":{"gravatar_id":"b8aca816cb8646a855175f64bdfa2838","id":11246,"url":"https://api.github.com/users/jaylevitt","avatar_url":"https://secure.gravatar.com/avatar/b8aca816cb8646a855175f64bdfa2838?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jaylevitt"},"body":"Since #449 and #458 weren't merged, the underlying problem still exists:\r\n\r\nWhen CarrierWave is loaded, the Configuration module is loaded prior to setting CarrierWave.root. At the time the configuration 'defaults' are established, CarrierWave.root is nil, causing Uploader instances to initially carry a #root value of nil, unless config.root is explicitly configured either globally or on the Uploader instance.\r\n\r\nSee #449 for full description.","assignee":null,"id":2387156,"labels":[],"number":544,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"race condition still exists for #root","html_url":"https://github.com/jnicklas/carrierwave/issues/544","closed_at":null,"url":"https://api.github.com/repos/jnicklas/carrierwave/issues/544","milestone":null},"action":"created","comment":{"created_at":"2011-11-30T17:04:10Z","updated_at":"2011-11-30T17:04:10Z","user":{"gravatar_id":"56e1be496db35190642b3e718789d44f","id":76392,"url":"https://api.github.com/users/davekapp","avatar_url":"https://secure.gravatar.com/avatar/56e1be496db35190642b3e718789d44f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"davekapp"},"body":"I don't recommend this as a real fix, but in the meantime this seems to (somewhat clunkily) work around the issue for me:\r\n\r\n       def url\r\n          if file.respond_to?(:url) and not file.url.blank?\r\n            file.url\r\n          elsif current_path\r\n            root_path = root.nil? ? Rails.root.to_s : root\r\n            (base_path || \"\") + File.expand_path(current_path).gsub(File.expand_path(root_path), '')\r\n          end\r\n       end\r\n","id":2962585,"url":"https://api.github.com/repos/jnicklas/carrierwave/issues/comments/2962585"}}