add helper to show if a pet or mount is owned by the user

This commit is contained in:
Etienne Ischer
2021-04-30 12:49:31 +02:00
parent 639bd044bf
commit ca80fd55fa
6 changed files with 11 additions and 3 deletions

View File

@@ -1,4 +1,7 @@
# frozen_string_literal: true
module WowMountsHelper
def mount_owned?(mount)
mount.users.include? current_user
end
end

View File

@@ -1,4 +1,7 @@
# frozen_string_literal: true
module WowPetsHelper
def pet_owned?(pet)
pet.users.include? current_user
end
end