<commit_before><?php namespace App;

/**
 * Created by PhpStorm.
 * User: melon
 * Date: 7/7/15
 * Time: 10:19 AM
 */

use App\Building;
use App\Room;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Campus extends Model
{
    use SoftDeletes;
    protected $table = 'campuses';
    protected $dates = ['deleted_at'];

    public function buildings()
    {
        return $this->hasMany('App\Building');
    }

    public function rooms()
    {
        return $this->buildings()->hasMany('App\Room');
    }

}
<commit_msg>trying to pass campus deltions down to the room level<commit_after><?php namespace App;

/**
 * Created by PhpStorm.
 * User: melon
 * Date: 7/7/15
 * Time: 10:19 AM
 */

use App\Building;
use App\Room;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Campus extends Model
{
    use SoftDeletes;
    protected $table = 'campuses';
    protected $dates = ['deleted_at'];

    public function buildings()
    {
        return $this->hasMany('App\Building');
    }

    public function rooms()
    {
        $rooms = array();
        $buildings = $this->buildings();
        foreach ($buildings as $building) {
            $rooms = array_merge($building->rooms(), $rooms);
        }
        return $rooms;
    }

}

{'fraction_non_alphanumeric': 0.1346444780635401, 'fraction_numerical': 0.012102874432677761, 'mean_word_length': 2.8347826086956522, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2605303', 'n_tokens_mistral': 442, 'n_tokens_neox': 429, 'n_words': 106}