Use diaspora_id validation from the federation gem

DRY
This commit is contained in:
cmrd Senya 2016-04-20 13:51:31 +03:00
parent fedd378dcf
commit 6fba0e498e
No known key found for this signature in database
GPG key ID: 5FCC5BA680E67BFE

View file

@ -185,7 +185,7 @@ class PeopleController < ApplicationController
end
def diaspora_id?(query)
!query.try(:match, /^(\w)*@([a-zA-Z0-9]|[-]|[.]|[:])*$/).nil?
!(query.nil? || query.lstrip.empty?) && Validation::Rule::DiasporaId.new.valid_value?(query)
end
# view this profile on the home pod, if you don't want to sign in...