Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Restrict null primary keys on update/delete, resolves #203 #205

Merged
merged 5 commits into from Jun 21, 2014
Merged

Restrict null primary keys on update/delete, resolves #203 #205

merged 5 commits into from Jun 21, 2014

Conversation

ghost
Copy link

@ghost ghost commented May 29, 2014

No description provided.

@treffynnon
Copy link
Collaborator

Thank you for the pull request. Please could you add tests for these changes to the pull request.

@ghost
Copy link
Author

ghost commented Jun 7, 2014

No problem, tests committed.

@ghost
Copy link
Author

ghost commented Jun 19, 2014

Not sure what the merge conflicts are here @treffynnon, did you want me to close this and resubmit a clean pull request?

@treffynnon
Copy link
Collaborator

There's no need to close the pull request. Just update the branch.

@ghost
Copy link
Author

ghost commented Jun 19, 2014

I'm not sure what the conflicts are.

@charsleysa
Copy link
Contributor

@cainmi try using git rebase, it should tell you where the conflicts are.

@treffynnon
Copy link
Collaborator

If you pull in the develop branch from j4mie/idiorm into your cainmi/develop branch again it should throw a merge conflict that'll indicate where the problems are.

@ghost
Copy link
Author

ghost commented Jun 19, 2014

This is failing on 5.2, due to an old version of PHPUnit.

Should I throw a custom exception, similar to 47f6dea?

@treffynnon
Copy link
Collaborator

You could wrap the call in a try/catch:

try {
    $widget = ORM::for_table('widget')
            ->use_id_column(array('id', 'primary'))
            ->select('foo')
            ->where('id', 1)
            ->where('primary', 1)
            ->find_one()
        ;

        $widget->id(true);
} catch(Exception $e) {
    return; // short-circuit to get pass
}
$this->fail('Exception was not thrown when it should have been'); // force a PHPUnit failure if we get past the exception

treffynnon added a commit that referenced this pull request Jun 21, 2014
Restrict null primary keys on update/delete, resolves #203
@treffynnon treffynnon merged commit 6dbd879 into j4mie:develop Jun 21, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants