class TastingsController < ApplicationController

  # redirect back to events show_quiz method
  def create
    event_wine = EventWine.find(params[:event_wine_id])
    event = event_wine.event
    tasting = current_user.tastings.create(tasting_params)

    redirect_to "/events/#{event.id}/quiz"
  end

  private
  def tasting_params
    params.permit([:event_wine_id, :red_fruits, :white_fruits, :fruit_condition, :minerality, :oak, :dry, :acid, :tannin, :alcohol, :climate, :country, :red_grape, :white_grape, :tasting_notes])
  end
end

class TastingsController < ApplicationController

  # redirect back to events show_quiz method
  def create
    event_wine = EventWine.find(params[:event_wine_id])
    event = event_wine.event
    tasting = current_user.tastings.create(tasting_params)

    if tasting.wine == event.event_wines.find_by(wine_bringer: current_user).wine
      tasting.update(is_blind: false)
    end
    redirect_to "/events/#{event.id}/quiz"
  end

  private
  def tasting_params
    params.permit([:event_wine_id, :red_fruits, :white_fruits, :fruit_condition, :minerality, :oak, :dry, :acid, :tannin, :alcohol, :climate, :country, :red_grape, :white_grape, :tasting_notes])
  end
end

Add active record query to mark non-blinded wines
Add active record query to mark non-blinded wines
