-
-
Save joerixaop/745260 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this only gets cached in @admin if true | |
# how to cache this also in case of false? | |
def admin? | |
@admin ||= has_role? 'admin' | |
end | |
#is the following ok? | |
def admin? | |
return @admin if defined? @admin | |
@admin ||= has_role? 'admin' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment