Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Added notTranslatedIn scopes #235

Merged
merged 1 commit into from
Apr 21, 2016
Merged

Added notTranslatedIn scopes #235

merged 1 commit into from
Apr 21, 2016

Conversation

Frozire
Copy link
Contributor

@Frozire Frozire 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.

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Frozire
Copy link
Contributor Author

Frozire 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
@dimsav
Copy link
Owner

dimsav commented Apr 21, 2016

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants