diff --git a/config/environment.rb b/config/environment.rb index b036d1a3..ecf7016a 100755 --- a/config/environment.rb +++ b/config/environment.rb @@ -282,6 +282,11 @@ Config.schema do end + #the url for your button. As a default, it takes what's in CDN.url + optional(:button_domain).schema do + required(:url).filled?(:str) + end + end Settings.reload! diff --git a/lib/tasks/settings.rake b/lib/tasks/settings.rake index 1f8093b7..d24c670b 100644 --- a/lib/tasks/settings.rake +++ b/lib/tasks/settings.rake @@ -12,10 +12,13 @@ namespace :settings do end task :generate_json => :environment do + cdn_url= URI(Settings.cdn.url) cdn_url.port = Settings.cdn.port if Settings.cdn.port cdn_url = cdn_url.to_s - + if (Settings.button_config.url) + cdn_url= URI(Settings.button_config.url).to_s + end c = {button:{url:cdn_url,css:"#{cdn_url}/css/donate-button.v2.css"}} open(File.expand_path('config/settings.json', Rails.root), 'w') do |f| f.write(c.to_json)