app/models/offer.rb
# we only want to inform the outside world about offers that are either remote
# offers or belong to a city with a certain number of approved offers and
# organizations
we only want to inform the outside world about offers that are either remote
offers or belong to a city with a certain number of approved offers and
organizations
we only want to inform the outside world about offers that are either remote offers or belong to a city with a certain number of approved offers and organizations
def remote_or_belongs_to_informable_city?
    city_by_area_name = area ? City.find_by(name: area.name) : nil
    direct_or_indirect_city = location ? location.city : city_by_area_name
    direct_or_indirect_city.nil? || direct_or_indirect_city.thresholds_reached?
  end
def remote_or_belongs_to_informable_city? city_by_area_name = area ? City . find_by ( name : area . name ) : nil direct_or_indirect_city = location ? location . city : city_by_area_name direct_or_indirect_city . nil? || direct_or_indirect_city . thresholds_reached? end
we only want to inform the outside world about offers that are either remote
offers or belong to a city with a certain number of approved offers and
organizations
we only want to inform the outside world about offers that are either remote offers or belong to a city with a certain number of approved offers and organizations
# search a city by area (remote offers that are limited to a certain area)