Created
July 18, 2013 05:08
-
-
Save austinrfnd/6026848 to your computer and use it in GitHub Desktop.
Yup
This file contains hidden or 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
def admin | |
if read_attribute(:admin) == "t" || read_attribute(:admin) == "1" | |
true | |
else | |
false | |
end | |
end | |
def admin=(value) | |
if value == true || value == "true" || value == "t" || value == 1 | |
write_attribute(:admin, 't') | |
else | |
write_attribute(:admin, 'f') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment