Skip to content

Instantly share code, notes, and snippets.

@paulcsmith paulcsmith/repository.cr Secret
Last active Feb 11, 2020

Embed
What would you like to do?
class Repository
# table definitions...
# Then add this
def owner : Team | User
if super.is_a?(Team)
super.as(Team)
else
super.as(User)
end
end
def owner! : Team | User
if super.is_a?(Team)
super.as(Team)
else
super.as(User)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.