Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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