```ruby
module GroupsHelper

  def show_join_group_button?(person, group)
    if person == nil
      true
    else
      person.group_id != group.id
    end
  end

  def show_group_member_buttons?(person, group)
    if person == nil
      false
    else
      person.group_id == group.id
    end
  end
end
```

Change how group_id is found based on membership
user
```ruby
module GroupsHelper

  def show_join_group_button?(person, group)
    if person == nil
      true
    else
      Membership.pluck(:group_id).include?(group.id) == false
    end
  end

  def show_group_member_buttons?(person, group)
    if person == nil
      false
    else
      Membership.pluck(:group_id).include?(group.id) == true
    end
  end
end
```
assistant