Skip to content
This repository has been archived by the owner. It is now read-only.

Added notTranslatedIn scopes #235

Merged
merged 1 commit into from Apr 21, 2016

Conversation

@Frozire
Copy link
Contributor

commented Apr 14, 2016

Added a scope (notTranslatedIn) for fetching by those who doesn't have a specific translation.

Useful for creating a view to translate content and filtering by missing translations.

@Frozire Frozire force-pushed the Frozire:master branch from 6e4ca46 to 9c0c925 Apr 14, 2016

public function test_not_translated_in_scope_returns_only_not_translated_records_for_this_locale()
{
$notTranslatedCountries = Country::notTranslatedIn('en')->get();

This comment has been minimized.

Copy link
@dimsav

dimsav Apr 21, 2016

Owner

This is really great! Can you please assert here that count(notTranslatedCountries) is positive?

{
App::setLocale('en');
$notTranslatedCountries = Country::notTranslatedIn()->get();

This comment has been minimized.

Copy link
@dimsav

dimsav Apr 21, 2016

Owner

same here

@Frozire Frozire force-pushed the Frozire:master branch from d326718 to cfc7f70 Apr 21, 2016

@Frozire

This comment has been minimized.

Copy link
Contributor Author

commented Apr 21, 2016

@dimsav - I added two checks for counting the objects and I squashed the new commits into one.

@dimsav dimsav merged commit a614864 into dimsav:master Apr 21, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dimsav

This comment has been minimized.

Copy link
Owner

commented Apr 21, 2016

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.