Add table for weather observation (Stacked PR)#3452
Conversation
| private | ||
|
|
||
| def weather_observation_params | ||
| params.require(:weather_observation).permit! |
Check warning
Code scanning / Brakeman
Specify exact keys allowed for mass assignment instead of using `permit!` which allows any keys.
| include in-active | ||
| - if @owner.present? | ||
| %hr/ | ||
| = render @owner |
Check notice
Code scanning / Brakeman
Render path contains parameter value.
| flash[:notice] = I18n.t('weather_observations.created') if @weather_observation.save | ||
| respond_with(@weather_observation) | ||
| end | ||
|
|
There was a problem hiding this comment.
Unexpected trailing spaces found.
| flash[:notice] = I18n.t('weather_observations.updated') if @weather_observation.update(weather_observation_params) | ||
| respond_with(@weather_observation) | ||
| end | ||
|
|
There was a problem hiding this comment.
Unexpected trailing spaces found.
| flash[:notice] = I18n.t('weather_observations.deleted') | ||
| redirect_to(member_weather_observations_path(@weather_observation.owner)) | ||
| end | ||
|
|
There was a problem hiding this comment.
Unexpected trailing spaces found.
| end | ||
|
|
||
| private | ||
|
|
There was a problem hiding this comment.
Unexpected trailing spaces found.
| params.require(:weather_observation).permit! | ||
| end | ||
| end | ||
|
No newline at end of file |
There was a problem hiding this comment.
Expected a newline at the end of the file.
| params.require(:weather_observation).permit! | ||
| end | ||
| end | ||
|
No newline at end of file |
There was a problem hiding this comment.
Unexpected trailing spaces found.
| = render 'weather_observations/actions', weather_observation: weather_observation | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Unexpected trailing spaces found.
| %strong= @weather_observation | ||
| .col-md-3.col-12 | ||
| = render 'weather_observations/actions', weather_observation: @weather_observation | ||
| .row |
There was a problem hiding this comment.
The line was indented 2 levels deeper than the previous line.
| @@ -0,0 +1,18 @@ | |||
| - if can?(:edit, garden) | |||
| .dropdown.garden-actions | |||
| %a#garden-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'} Actions | |||
There was a problem hiding this comment.
Line is too long. [167/120]
| @@ -0,0 +1,18 @@ | |||
| - if can?(:edit, garden) | |||
| .dropdown.garden-actions | |||
| %a#garden-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'} Actions | |||
There was a problem hiding this comment.
Hash attribute should start with one space after the opening brace
#3453 first
A small part of:
#1165
#863
Also kind of like:
https://github.com/Growstuff/growstuff/pull/1307/files
Based on schemaorg/schemaorg#362
The idea would be to only record specific observations, with a source that have happened.
Ideally this would be from either:
Use cases:
As gardener with various observation tools
I would like to record a snapshot of weather (manually)
So that I have a history of what was happening in my own microclimate
And I can compare to crop yields.
As gardener with home automation
I would like to record a snapshot of weather
So that I have a history of what was happening in my own microclimate
And I can compare to crop yields.