Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Dynamic fog configuration #711

Merged
merged 4 commits into from Jan 27, 2012

Conversation

Projects
None yet
3 participants
Contributor

maxigs commented Jan 20, 2012

Simple addition to allow procs in the fog_config_options (bucket-name, authentication, and host)

@mike-burns mike-burns commented on an outdated diff Jan 27, 2012

lib/paperclip/storage/fog.rb
@@ -126,7 +126,12 @@ def to_file(style = default_style)
def public_url(style = default_style)
if @options[:fog_host]
- host = (@options[:fog_host] =~ /%d/) ? @options[:fog_host] % (path(style).hash % 4) : @options[:fog_host]
+ host = if @options[:fog_host].is_a?(Proc)
@mike-burns

mike-burns Jan 27, 2012

Owner

Switch this to a respond_to?(:call) check, and the ones below on lines 166 and 178, and I'll pull this.

@sikachu sikachu added a commit that referenced this pull request Jan 27, 2012

@sikachu sikachu Merge pull request #711 from maxigs/dynamic-fog-configuration
Simple addition to allow procs in the fog_config_options (bucket-name, authentication, and host)
5ffcc85

@sikachu sikachu merged commit 5ffcc85 into thoughtbot:master Jan 27, 2012

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