Skip to content

Commit

Permalink
Merge pull request #213 from NikitaRubocki/develop
Browse files Browse the repository at this point in the history
Beginning query consolidation
  • Loading branch information
NikitaRubocki authored Apr 25, 2022
2 parents cd52b60 + 46d74c3 commit 8b2c391
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/soil_samples_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class SoilSamplesController < ApplicationController
before_action :set_soil_sample, only: [:show, :edit, :update, :destroy]

def index
@soil_samples = SoilSample.order(collected_on: :desc).page(params[:page])
@soil_samples = SoilSample.order(collected_on: :desc).page(params[:page]).includes(:plot, :nutrients)
end

def show; end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class SpeciesVariationObservationsController < ApplicationController
before_action :set_species_variation_observation, only: [:show, :edit, :update, :destroy]

def index
@species_variation_observations = SpeciesVariationObservation.order(observed_on: :desc).page(params[:page])
@species_variation_observations = SpeciesVariationObservation.order(observed_on: :desc).page(params[:page]).includes(:plot, :plant)
end

def show
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/tree_samples_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class TreeSamplesController < ApplicationController
before_action :set_tree_sample, only: [:show, :edit, :update, :destroy]

def index
@tree_samples = TreeSample.order(collected_on: :desc).page(params[:page])
@tree_samples = TreeSample.order(collected_on: :desc).page(params[:page]).includes(:plot, :plant)
respond_to do |format|
format.html
format.csv { send_data @tree_samples.to_csv, filename: "treesamples-#{Date.today}.csv" }
Expand Down

0 comments on commit 8b2c391

Please sign in to comment.