<commit_before>class TripsController < ApplicationController
  respond_to :json

  def create
    @trip = Trip.create!(trip_params) { |t| t.user = current_user }

    render json: { status: true }
  end

  # def find_waypoint_attraction
  #   Attraction.where(latitude: @trip.map_waypoints.location.k && longitude: @trip.map_waypoints.location.D)
  # end

  private

  def trip_params
    params.require(:trip).permit(:origin, :destination, :pitstop)
  end

end<commit_msg>trips controller created to handle trip saving<commit_after>class TripsController < ApplicationController
  respond_to :json

  def create
    @trip = Trip.create!(trip_params) { |t| t.user = current_user }

    render json: { status: true }
  end

  private

  def trip_params
    params.require(:trip).permit(:origin, :destination, :pitstop, {:map_waypoints => [{:location => [:k, :D]}, :stopover]})
  end

end
{'fraction_non_alphanumeric': 0.11751412429378531, 'fraction_numerical': 0.0, 'mean_word_length': 4.242603550295858, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4494067', 'n_tokens_mistral': 304, 'n_tokens_neox': 281, 'n_words': 67}