laravel-ardent / ardent

Self-validating, secure and smart models for Laravel's Eloquent ORM
BSD 3-Clause "New" or "Revised" License
1.39k stars 211 forks source link

Custom purge filters not working with autoHash #282

Closed mvsantoss closed 8 years ago

mvsantoss commented 8 years ago

Hi, custom purge filters are not working with both auto purge and auto hash enabled. Model Code:

public $autoPurgeRedundantAttributes = true;
public $autoHashPasswordAttributes = true;

public function __construct(array $attributes = array()) {
    parent::__construct($attributes);
    $this->purgeFilters[] = function($key) {
        $purge = array('avatar');
            return !in_array($key, $purge);
        };
    }
mvsantoss commented 8 years ago

I noticed that $forceEntityHydrationFromInput was enabled and causing my problem.