Skip to content

Instantly share code, notes, and snippets.

@austinrfnd
Created July 18, 2013 05:08
Show Gist options
  • Save austinrfnd/6026848 to your computer and use it in GitHub Desktop.
Save austinrfnd/6026848 to your computer and use it in GitHub Desktop.
Yup
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