<commit_before><?php
namespace Stakes\Controllers;

use Stakes\Models\Transaction;
use Stakes\Transformers\TransactionTransformer;

class TransactionsController extends ApiController {

    /**
	 * Display a listing of the resource.
	 * GET /transactions
	 *
	 * @return Response
	 */
    public function index() {
        $users = Transaction::get();

        return $this->respondWithCollection($users, new TransactionTransformer);
    }

    /**
	 * Store a newly created resource in storage.
	 * POST /transactions
	 *
	 * @return Response
	 */
    public function store() {
        //
    }

    /**
	 * Display the specified resource.
	 * GET /transactions/{transaction_id}
	 *
	 * @param int     $transaction_id
	 * @return Response
	 */
    public function show($transaction_id) {
        $transaction = Transaction::where('transaction_id', '=', $transaction_id)->first();
        if (is_null($transaction)) {
            return $this->errorNotFound();
        }
        return $this->respondWithItem($transaction, new TransactionTransformer);
    }

    /**
	 * Update the specified resource in storage.
	 * PUT /transactions/{transaction_id}
	 *
	 * @param int     $transaction_id
	 * @return Response
	 */
    public function update($transaction_id) {
        //
    }

    /**
	 * Remove the specified resource from storage.
	 * DELETE /transactions/{transaction_id}
	 *
	 * @param int     $transaction_id
	 * @return Response
	 */
    public function destroy($transaction_id) {
        //
    }

}
<commit_msg>Eager load trans + accounts<commit_after><?php
namespace Stakes\Controllers;

use Input;
use Stakes\Models\Transaction;
use Stakes\Transformers\TransactionTransformer;

class TransactionsController extends ApiController {

    /**
	 * Display a listing of the resource.
	 * GET /transactions
	 *
	 * @return Response
	 */
    public function index() {
        $includes = Input::get('include');
        if ($includes === 'account') {
            $transactions = Transaction::with($includes)->get();
        } else {
            $transactions = Transaction::get();
        }

        return $this->respondWithCollection($transactions, new TransactionTransformer);
    }

    /**
	 * Store a newly created resource in storage.
	 * POST /transactions
	 *
	 * @return Response
	 */
    public function store() {
        //
    }

    /**
	 * Display the specified resource.
	 * GET /transactions/{transaction_id}
	 *
	 * @param int     $transaction_id
	 * @return Response
	 */
    public function show($transaction_id) {
        $transaction = Transaction::where('transaction_id', '=', $transaction_id)->first();
        if (is_null($transaction)) {
            return $this->errorNotFound();
        }
        return $this->respondWithItem($transaction, new TransactionTransformer);
    }

    /**
	 * Update the specified resource in storage.
	 * PUT /transactions/{transaction_id}
	 *
	 * @param int     $transaction_id
	 * @return Response
	 */
    public function update($transaction_id) {
        //
    }

    /**
	 * Remove the specified resource from storage.
	 * DELETE /transactions/{transaction_id}
	 *
	 * @param int     $transaction_id
	 * @return Response
	 */
    public function destroy($transaction_id) {
        //
    }

}

{'fraction_non_alphanumeric': 0.119215445908673, 'fraction_numerical': 0.0, 'mean_word_length': 2.6387959866220734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '3432168', 'n_tokens_mistral': 913, 'n_tokens_neox': 848, 'n_words': 215}