Skip to content
Browse files

added terse_pod_url to the APP_CONFIG hash

  • Loading branch information...
1 parent d60dc03 commit 6d6ca3d8bca9707b302e051b3bd936e29b524cc2 ilya committed Sep 21, 2010
Showing with 6 additions and 6 deletions.
  1. +2 −5 app/models/user.rb
  2. +4 −1 config/initializers/_load_app_config.rb
View
7 app/models/user.rb
@@ -239,11 +239,8 @@ def update_profile(params)
###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
View
5 config/initializers/_load_app_config.rb
@@ -20,4 +20,7 @@ def load_config_yaml filename
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

0 comments on commit 6d6ca3d

Please sign in to comment.
Something went wrong with that request. Please try again.