```ruby
class PiePiece < ActiveRecord::Base
  belongs_to :pie
end
```

Add user scope to pie pieces
user
```ruby
class PiePiece < ActiveRecord::Base
  belongs_to :pie
  has_one :users, through: :pie
  scope :user, ->(id) {
    joins(:users)
    .where('users.id = ?', id)
  }
end
```
assistant