MS fixed the nil hostname on user

This commit is contained in:
maxwell 2010-09-16 14:38:24 -07:00
parent 1d616f001a
commit 6f867d60c4

View file

@ -286,9 +286,13 @@ class User
###Helpers############
def self.instantiate!( opts = {} )
opts[:person][:diaspora_handle] = "#{opts[:username]}@#{URI::parse(opts[:url]).host}"
hostname = opts[:url].gsub(/(https?:|www\.)\/\//, '')
hostname.chop! if hostname[-1, 1] == '/'
opts[:person][:diaspora_handle] = "#{opts[:username]}@#{hostname}"
puts opts[:person][:diaspora_handle]
opts[:person][:serialized_key] = generate_key
User.create!(opts)
User.create(opts)
end
def seed_aspects
@ -296,10 +300,6 @@ class User
aspect(:name => "Work")
end
def self.create(opts ={})
puts opts.inspect
end
def terse_url
terse = self.url.gsub(/(https?:|www\.)\/\//, '')
terse = terse.chop! if terse[-1, 1] == '/'