<commit_before>class BookmarksController < ApplicationController
  before_action :set_bookmark, only: [:show, :update, :destroy, :increase_view_count]

  # GET /bookmarks
  def index
    if params[:tag]
      @bookmarks = Bookmark.tagged_with(params[:tag])
    else
      @bookmarks = Bookmark.where(user_id: @current_user.id).order('created_at DESC').includes(:tags, :taggings)
    end

    render json: @bookmarks, :include => :tags
  end

  # GET /bookmarks/1
  def show
    render json: @bookmark, :include => :tags
  end

  # POST /bookmarks
  def create
    # @bookmark = Bookmark.new(bookmark_params)
    @bookmark = @current_user.bookmarks.build(bookmark_params)

    if @bookmark.save
      render json: @bookmark, status: :created, location: @bookmark
    else
      render json: @bookmark.errors, status: :unprocessable_entity
    end
  end

  # PATCH/PUT /bookmarks/1
  def update
    if @bookmark.update(bookmark_params)
      render json: @bookmark
    else
      render json: @bookmark.errors, status: :unprocessable_entity
    end
  end

  # DELETE /bookmarks/1
  def destroy
    @bookmark.destroy
  end
<commit_msg>set bookmarks_controller update method to include the tags in the json response<commit_after>class BookmarksController < ApplicationController
  before_action :set_bookmark, only: [:show, :update, :destroy, :increase_view_count]

  # GET /bookmarks
  def index
    if params[:tag]
      @bookmarks = Bookmark.tagged_with(params[:tag])
    else
      @bookmarks = Bookmark.where(user_id: @current_user.id).order('created_at DESC').includes(:tags, :taggings)
    end

    render json: @bookmarks, :include => :tags
  end

  # GET /bookmarks/1
  def show
    render json: @bookmark, :include => :tags
  end

  # POST /bookmarks
  def create
    # @bookmark = Bookmark.new(bookmark_params)
    @bookmark = @current_user.bookmarks.build(bookmark_params)

    if @bookmark.save
      render json: @bookmark, status: :created, location: @bookmark
    else
      render json: @bookmark.errors, status: :unprocessable_entity
    end
  end

  # PATCH/PUT /bookmarks/1
  def update
    if @bookmark.update(bookmark_params)
      render json: @bookmark, :include => :tags
    else
      render json: @bookmark.errors, status: :unprocessable_entity
    end
  end

  # DELETE /bookmarks/1
  def destroy
    @bookmark.destroy
  end

{'fraction_non_alphanumeric': 0.10174542358450404, 'fraction_numerical': 0.002554278416347382, 'mean_word_length': 3.4761904761904763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '2398947', 'n_tokens_mistral': 777, 'n_tokens_neox': 756, 'n_words': 191}