소스 검색

Add expected fields to search form if they're missing. Fix #6

This structure allows us to add other missing fields easily if necessary.
tags/v0.4.5
Adrian Short 6 년 전
부모
커밋
9229f1ff55
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      lib/uk_planning_scraper/idox.rb

+ 6
- 1
lib/uk_planning_scraper/idox.rb 파일 보기

@@ -24,7 +24,12 @@ module UKPlanningScraper

# Fill out and submit search form

# Some councils don't have the received from/to dates on their form, eg Newham
# Add expected fields to form if they're not already present so that searches using these terms work
%w{
date(applicationReceivedStart)
date(applicationReceivedEnd)
}.each { |f| form.add_field!(f) unless form.has_field?(f) }

form.send(:"date(applicationReceivedStart)", params[:received_from].strftime("%d/%m/%Y")) if params[:received_from]
form.send(:"date(applicationReceivedEnd)", params[:received_to].strftime("%d/%m/%Y")) if params[:received_to]



불러오는 중...
취소
저장