Skip to content

Commit

Permalink
Merge pull request #7 from marcoelho97/develop
Browse files Browse the repository at this point in the history
Fix: Indentation and commented code block removed
  • Loading branch information
marcoelho97 authored Nov 19, 2024
2 parents f1a85d0 + 9a0500c commit 83889d7
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions app/controllers/weather_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,11 @@ def historical
end

weather_response["daily"]["time"].each_with_index do |day, index|

HistoricalWeather.find_or_create_by(date: day) do |hw|
hw.location = location
hw.temperature = (weather_response["daily"]["temperature_2m_max"][index] + weather_response["daily"]["temperature_2m_min"][index]) / 2 # Average temperature
hw.precipitation = weather_response["daily"]["precipitation_probability_max"][index]
end

# HistoricalWeather.create!(
# location: location,
# date: day,
# temperature: (weather_response["daily"]["temperature_2m_max"][index] + weather_response["daily"]["temperature_2m_min"][index]) / 2, # Average temperature
# precipitation: weather_response["daily"]["precipitation_probability_max"][index]
# )
end

weather_data = HistoricalWeather.where(location: location, date: parsed_start_date..parsed_end_date).order(:date)
Expand Down

0 comments on commit 83889d7

Please sign in to comment.