From 3d9b5b5701497a89638c035ce987a02eba0309d3 Mon Sep 17 00:00:00 2001 From: Hugo Melo Date: Wed, 14 Oct 2015 17:12:25 -0300 Subject: [PATCH] Add check for profile completion. hardcoded for juv --- lib/ext/person.rb | 11 +++++++++++ 1 file changed, 11 insertions(+), 0 deletions(-) diff --git a/lib/ext/person.rb b/lib/ext/person.rb index b599a07..ea68a13 100644 --- a/lib/ext/person.rb +++ b/lib/ext/person.rb @@ -6,6 +6,17 @@ class Person attr_accessible :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia + def is_profile_complete? + #FIXME: this check is hardcoded to satisfy a temporary issue. + #a better fix is being implemented already + !(self.name.blank? or + (self.data[:identidade_genero].blank? and self.data[:transgenero].blank?) or + self.data[:etnia].blank? or + self.data[:orientacao_sexual].blank? or + self.data[:state].blank? or + self.data[:city].blank?) + end + def conference_comments Profile['conferencia'].comments_received.where(author_id: id) end -- libgit2 0.21.2