From 99bf0aae8c9705c6af625efe7a7d4393f02a9429 Mon Sep 17 00:00:00 2001 From: Evandro Junior Date: Wed, 6 Apr 2016 14:51:00 -0300 Subject: [PATCH] Fix problems with person = nil --- app/models/organization.rb | 2 +- app/models/person.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/organization.rb b/app/models/organization.rb index 2695ce4..b064ffe 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -18,7 +18,7 @@ class Organization < Profile # visible, public and enabled. def self.visible_for_person(person) # Visitor if person.nil? - person.nil? ? person_id = nil : person_id = person.id + person_id = person.nil? ? nil : person.id joins('LEFT JOIN "role_assignments" ON ("role_assignments"."resource_id" = "profiles"."id" AND "role_assignments"."resource_type" = \'Profile\') OR ( "role_assignments"."resource_id" = "profiles"."environment_id" AND diff --git a/app/models/person.rb b/app/models/person.rb index 65a9ef6..560138e 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -43,7 +43,7 @@ class Person < Profile scope :visible_for_person, lambda { |person| # Visitor if person.nil? - person.nil? ? person_id = nil : person_id = person.id + person_id = person.nil? ? nil : person.id joins('LEFT JOIN "role_assignments" ON "role_assignments"."resource_id" = "profiles"."environment_id" AND "role_assignments"."resource_type" = \'Environment\'') -- libgit2 0.21.2