lib/parliament/utils/helpers/postcode_helper.rb in parliament-utils-0.2.0 vs lib/parliament/utils/helpers/postcode_helper.rb in parliament-utils-0.2.1

- old
+ new

@@ -16,10 +16,10 @@ # @return [Parliament::Response::NTripleResponse, Parliament::ClientError, Parliament::ServerError] if successful, a response is returned, otherwise an error is returned. def self.lookup(raw_input) postcode = clean_input(raw_input) begin - Parliament::Utils::Helpers::ParliamentHelper.parliament_request.constituencies.postcode_lookup(postcode).get + Parliament::Utils::Helpers::ParliamentHelper.parliament_request.constituency_lookup_by_postcode.get(params: { postcode: postcode }) rescue Parliament::ClientError raise(PostcodeError, I18n.t('error.no_constituency').capitalize) rescue Parliament::ServerError raise(PostcodeError, I18n.t('error.lookup_unavailable').capitalize) end