Skip to content

Instantly share code, notes, and snippets.

@lucianosousa
Created August 22, 2019 13:57
Show Gist options
  • Save lucianosousa/ba4245f410c9323b3646463de72a6bb4 to your computer and use it in GitHub Desktop.
Save lucianosousa/ba4245f410c9323b3646463de72a6bb4 to your computer and use it in GitHub Desktop.
sorbet or not sorbet?
# Old file start
module EventsHelper
def user_is_owner?(model)
user_signed_in? && model.user == current_user
end
end
# Old file end
# New file start
# typed: false
module EventsHelper
extend T::Sig
sig { params(model: T.any(Event, Proposal)).returns(T.any(TrueClass, FalseClass)) }
def user_is_owner?(model)
user_signed_in? && model.user == current_user
end
end
# New file end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment