Skip to content

Commit

Permalink
Fix wrong subscribable reference
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
gerardojbaez committed Feb 23, 2018
1 parent 8ee1e25 commit 8a23b42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Support for Laravel 5.4
- `SubscriptionDeleted` event.

### Fixed
- Renamed `user_id` to `subscribable_id`, fixes #30

## [2.1.0] - 2017-11-27

### Added
Expand Down
8 changes: 4 additions & 4 deletions src/Laraplans/Models/PlanSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,15 @@ public function ability()
}

/**
* Find by user id.
* Find by subscribable id.
*
* @param \Illuminate\Database\Eloquent\Builder
* @param int $user_id
* @param int $subscribable
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeByUser($query, $user_id)
public function scopeByUser($query, $subscribable)
{
return $query->where('user_id', $user_id);
return $query->where('subscribable_id', $subscribable);
}

/**
Expand Down

0 comments on commit 8a23b42

Please sign in to comment.