app/models/gtfs_api/trip.rb
# Valdiates that the shape_id exists if the attribute has been set
Valdiates that the shape_id exists if the attribute has been set
Valdiates that the shape_id exists if the attribute has been set
def shape_id_exists_if_set
      if shape_id.present?
        errors.add(:shape_id, :not_found) if Shape.find_by(io_id: shape_id).nil?
      end
    end
def shape_id_exists_if_set if shape_id . present? errors . add ( :shape_id , :not_found ) if Shape . find_by ( io_id : shape_id ) . nil? end end
Valdiates that the shape_id exists if the attribute has been set
Valdiates that the shape_id exists if the attribute has been set