app/models/gtfs_api/fare_rule.rb
def validate_stop_zone_id_exists(attribute_sym)
      if attribute_sym.present?
          errors.add(attribute_sym, :not_found) if Stop.find_by(zone_id: self[attribute_sym]).nil?
      end
    end
# checks if the value of the attribute exists as zone_id in Stops
# if the zone_id is not found, adds to the attriburte a :not_found
# validation error
#
# @param attribute_sym[Symbol] attribute with the name of the zone_id(string)
checks if the value of the attribute exists as zone_id in Stops
if the zone_id is not found, adds to the attriburte a :not_found
validation error
checks if the value of the attribute exists as zone_id in Stops if the zone_id is not found adds to the attriburte a : not_found validation error
def validate_stop_zone_id_exists(attribute_sym)
      if attribute_sym.present?
          errors.add(attribute_sym, :not_found) if Stop.find_by(zone_id: self[attribute_sym]).nil?
      end
    end
def validate_stop_zone_id_exists ( attribute_sym ) if attribute_sym . present? errors . add ( attribute_sym , :not_found ) if Stop . find_by ( zone_id : self [ attribute_sym ] ) . nil? end end
checks if the value of the attribute exists as zone_id in Stops
if the zone_id is not found, adds to the attriburte a :not_found
validation error
checks if the value of the attribute exists as zone_id in Stops if the zone_id is not found adds to the attriburte a : not_found validation error
attribute_sym
attribute with the name of the zone_id(string)
attribute with the name of the zone_id ( string )