Skip to content

Commit

Permalink
Merge pull request #19 from mkwsra/patch-2
Browse files Browse the repository at this point in the history
Fix User relation
  • Loading branch information
willvincent authored Oct 10, 2017
2 parents 72e8ad2 + 974a224 commit ff56cc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Rateable/Rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function rateable()
*/
public function user()
{
return $this->belongsTo(Config::get('auth.model'));
$userClassName = Config::get('auth.model');
if (is_null($userClassName)) {
$userClassName = Config::get('auth.providers.users.model');
}

return $this->belongsTo($userClassName);
}
}

0 comments on commit ff56cc4

Please sign in to comment.