From 6d6ca3d8bca9707b302e051b3bd936e29b524cc2 Mon Sep 17 00:00:00 2001 From: ilya <ilya@laptop.(none)> Date: Tue, 21 Sep 2010 20:01:56 -0700 Subject: [PATCH] added terse_pod_url to the APP_CONFIG hash --- app/models/user.rb | 7 ++----- config/initializers/_load_app_config.rb | 5 ++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 928a02173b..c68cbb6dcc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -239,11 +239,8 @@ class User ###Helpers############ def self.instantiate!( opts = {} ) - terse_url = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') - terse_url.chop! if terse_url[-1, 1] == '/' - - opts[:person][:diaspora_handle] = "#{opts[:username]}@#{terse_url}" - opts[:person][:url] = APP_CONFIG[:pod_url] + opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" + pts[:person][:url] = APP_CONFIG[:pod_url] opts[:person][:serialized_key] = generate_key User.create(opts) end diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index 33f7b183be..521f9f0a04 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -20,4 +20,7 @@ else APP_CONFIG = all_envs['default'].symbolize_keys end -puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:pod_url] == "http://example.org/" && Rails.env != :test +APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') +APP_CONFIG[:terse_pod_url].chop! if APP_CONFIG[:terse_pod_url][-1, 1] == '/' + +puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != :test -- GitLab