From ad01be89c4bc976bc77c96b7bd20beb3e5a8e534 Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 6 May 2018 21:25:35 +0200 Subject: [PATCH] Another attempt at managing region with a parent one... --- app/models/event.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 0243e23c..9fcbd87e 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -87,8 +87,8 @@ class Event < ApplicationRecord def full_address # Only uses the region if it is a sub-region and not a country - [address, city, region, region.try(:region) ? region.try(:region) : nil] - .compact.join ', ' + [address, city, region.try(:region).present? ? region : nil, + region.try(:region)].compact.join ', ' end def hashtags