Skip to content

Instantly share code, notes, and snippets.

@KensoDev
Created May 8, 2012 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KensoDev/2636650 to your computer and use it in GitHub Desktop.
Save KensoDev/2636650 to your computer and use it in GitHub Desktop.
STATUS = { pending: 0, active: 1, inactive: 2, deleted: 3 }
def status
STATUS.key(read_attribute(:status))
end
def status=(s)
write_attribute(:status, STATUS[s])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment