Skip to content

Commit

Permalink
Merge pull request #1033 from FrozenNode/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
David Mathews authored Jun 23, 2016
2 parents b5b59c4 + f47c429 commit f350c91
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

### 5.0.12
- Bugfix: Added the table name to the constraint query
- Bugfix: Russian translate in knockout.php
- Bugfix: Update settings.php for `Request::url()` instead of using `url()`

### 5.0.11
- Bugfix: Had to make the middleware additon backwards compatable
- Docs: Added doc updates
Expand Down
7 changes: 6 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.11
- **Version:** 5.0.12

[![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,11 @@ Administrator is released under the MIT License. See the LICENSE file for detail

## Recent Changelog

### 5.0.12
- Bugfix: Added the table name to the constraint query
- Bugfix: Russian translate in knockout.php
- Bugfix: Update settings.php for `Request::url()` instead of using `url()`

### 5.0.11
- Bugfix: Had to make the middleware additon backwards compatable
- Docs: Added doc updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ public function constrainQuery(EloquentBuilder &$query, $relatedModel, $constrai
$query->join($this->getOption('table'), $relatedModel->getTable().'.'.$relatedModel->getKeyName(), '=', $this->getOption('column2'));
}

$query->where($this->getOption('column'), '=', $constraint);
$query->where($this->getOption('table').'.'.$this->getOption('column'), '=', $constraint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ public function fillModel(&$model, $input) {}
*/
public function constrainQuery(EloquentBuilder &$query, $relatedModel, $constraint)
{
$query->where($this->getOption('column'), '=', $constraint);
$query->where($this->getOption('table').'.'.$this->getOption('column'), '=', $constraint);
}
}
}
4 changes: 2 additions & 2 deletions src/lang/ru/knockout.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
'saved' => 'Элемент сохранён.',
'deleting' => 'Удаление...',
'deleted' => 'Элемент удалён.',
'character_left' => ' символ влево',
'characters_left' => ' символов влево',
'character_left' => ' символ остался',
'characters_left' => ' символов осталось',
'no_results' => 'Результатов не найдено',
'select_options' => 'Выберите',

Expand Down
4 changes: 2 additions & 2 deletions src/views/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</div>

<script type="text/javascript">
var site_url = "<?php echo url() ?>",
var site_url = "<?php echo Request::url() ?>",
base_url = "<?php echo $baseUrl ?>/",
asset_url = "<?php echo $assetUrl ?>",
save_url = "<?php echo route('admin_settings_save', array($config->getOption('name'))) ?>",
Expand All @@ -26,4 +26,4 @@

<script id="settingsTemplate" type="text/html">
<?php echo view("administrator::templates.settings")?>
</script>
</script>
4 changes: 2 additions & 2 deletions tests/Fields/Relationships/BelongsToManyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function testConstrainQueryNotJoined()
->shouldReceive('where')->once();
$this->validator->shouldReceive('isJoined')->once();
$model = m::mock(array('getTable' => 'table', 'getKeyName' => 'id'));
$this->field->shouldReceive('getOption')->times(4);
$this->field->shouldReceive('getOption')->times(5);
$this->field->constrainQuery($query, $model, 'foo');
}

Expand All @@ -165,7 +165,7 @@ public function testConstrainQueryAlreadyJoined()
->shouldReceive('where')->once();
$this->validator->shouldReceive('isJoined')->once()->andReturn(true);
$model = m::mock(array('getTable' => 'table', 'getKeyName' => 'id'));
$this->field->shouldReceive('getOption')->twice();
$this->field->shouldReceive('getOption')->times(3);
$this->field->constrainQuery($query, $model, 'foo');
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Fields/Relationships/HasOneOrManyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testConstrainQuery()
{
$query = m::mock('Illuminate\Database\Eloquent\Builder');
$query->shouldReceive('where')->once();
$this->field->shouldReceive('getOption')->once();
$this->field->shouldReceive('getOption')->twice();
$this->field->constrainQuery($query, m::mock(array()), 'foo');
}
}
}

0 comments on commit f350c91

Please sign in to comment.