Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Change isActive to be type agnostic #129

Merged
merged 1 commit into from
Oct 22, 2019

Conversation

MGatner
Copy link
Collaborator

@MGatner MGatner commented Oct 21, 2019

Entities/User.php currently checks if a user is active by checking if $this->attributes['active'] === true, but since internal functions don't use casts this attribute will rarely (never?) be a boolean. This PR changes the comparison to == which will allow for common database boolean type returns (e.g. 1).

@dafriend
Copy link
Contributor

Just my $.02, but I'd rather see isActivated() remain as-is and have $this->attributes['active'] always be explicity set with a boolean value.

@MGatner
Copy link
Collaborator Author

MGatner commented Oct 21, 2019

I get the desire, but I would rather see this entity perform in a consistent manner with the main framework, especially since this is (for now) the reference auth library, and probably even the main reference module. If there's a case for entities casting database booleans as language booleans I'd rather see it brought up in the framework core.

@lonnieezell lonnieezell merged commit d8ef464 into lonnieezell:develop Oct 22, 2019
@MGatner MGatner deleted the is-activate-bug branch October 22, 2019 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants