Skip to content

Conversation

@samdark
Copy link
Member

@samdark samdark commented Mar 10, 2017

Q A
Is bugfix? yes
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues #93
@samdark samdark self-assigned this Mar 10, 2017
@samdark samdark added the type:bug Bug label Mar 10, 2017
@samdark samdark added this to the 2.0.6 milestone Mar 10, 2017
ActiveQuery.php Outdated
if (is_array($this->where) && (
!isset($this->where[0]) && $modelClass::isPrimaryKey(array_keys($this->where)) ||
isset($this->where[0]) && $this->where[0] === 'in' && $modelClass::isPrimaryKey($this->where[1])
isset($this->where[0]) && $this->where[0] === 'in' && $modelClass::isPrimaryKey((array)$this->where[1])

Choose a reason for hiding this comment

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

You missed a space between (array) and casting value. Even within this file the other occurences of (array) are followed by space, so this is inconsistent and small code style violation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

public function testDeleteAllWithCondition()
{
$deletedCount = Order::deleteAll(['in', 'id', [1, 2, 3]]);
$this->assertEquals(3, $deletedCount);

Choose a reason for hiding this comment

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

Maybe convert this to one liner since it fits in one line?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. The variable is important for understanding the context in this case.

Choose a reason for hiding this comment

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

@samdark Indeed, it would be not absolutely clear without it. Nevermind then.

@samdark samdark merged commit 40190d2 into master Mar 13, 2017
@samdark samdark deleted the fix-deleteall-with-condition branch March 13, 2017 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants