Skip to content

Commit

Permalink
Merge pull request #946 from FrozenNode/dev
Browse files Browse the repository at this point in the history
Dev into master
  • Loading branch information
David Mathews committed Nov 5, 2015
2 parents 9910955 + cedf5df commit 2350237
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 5.0.7
- Bugfix: Fixed boolean true bug
- Bugfix: Fixes a bug where soft deletes are not being properly detected in L5

### 5.0.6
- Added: Support for custom domains in the admin routes
- Added: Ability to access the model from withinthe column output renderer
Expand Down
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Administrator is an administrative interface builder for [Laravel](http://larave

- **Author:** Jan Hartigan
- **Website:** [http://frozennode.com](http://administrator.frozennode.com/)
- **Version:** 5.0.6
- **Version:** 5.0.7

[![Build Status](https://travis-ci.org/FrozenNode/Laravel-Administrator.png?branch=master)](https://travis-ci.org/FrozenNode/Laravel-Administrator)

Expand Down Expand Up @@ -63,6 +63,10 @@ Administrator is released under the MIT License. See the LICENSE file for detail

## Recent Changelog

### 5.0.7
- Bugfix: Fixed boolean true bug
- Bugfix: Fixes a bug where soft deletes are not being properly detected in L5

### 5.0.6
- Added: Support for custom domains in the admin routes
- Added: Ability to access the model from withinthe column output renderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getRelationshipWheres($relationship, $tableAlias, $pivotAlias =
//one element of the relationship query's wheres is always useless (it will say pivot_table.other_id is null)
//depending on whether or not softdeletes are enabled on the other model, this will be in either position 0
//or 1 of the wheres array
array_splice($query->wheres, (isset($relationshipModel->runSoftDelete) ? 1 : 0), 1);
array_splice($query->wheres, (method_exists($relationshipModel, 'getDeletedAtColumn') ? 1 : 0), 1);

//iterate over the wheres to properly alias the columns
foreach ($query->wheres as &$where)
Expand Down
2 changes: 1 addition & 1 deletion src/Frozennode/Administrator/Fields/Bool.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function build()
*/
public function fillModel(&$model, $input)
{
$model->{$this->getOption('field_name')} = $input === 'true' || $input === '1' ? 1 : 0;
$model->{$this->getOption('field_name')} = $input === 'true' || $input === '1' || $input === true ? 1 : 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/DataTable/Columns/Relationships/RelationshipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testGetRelationshipWheres()
$eloquentQuery = m::mock('Illuminate\Database\Eloquent\Builder');
$eloquentQuery->shouldReceive('getQuery')->once()->andReturn($query);
$relatedModel = m::mock('Illuminate\Database\Eloquent\Model');
$relatedModel->shouldReceive('hasGetMutator')->once();
$relatedModel->shouldReceive('hasGetMutator')->never();
$relationship = m::mock('Illuminate\Database\Eloquent\Relations\Relation');
$relationship->shouldReceive('getQuery')->once()->andReturn($eloquentQuery)
->shouldReceive('getRelated')->once()->andReturn($relatedModel);
Expand Down

0 comments on commit 2350237

Please sign in to comment.