Skip to content

Instantly share code, notes, and snippets.

@cbguder
Created May 7, 2009 13:32
Show Gist options
  • Save cbguder/108091 to your computer and use it in GitHub Desktop.
Save cbguder/108091 to your computer and use it in GitHub Desktop.
def age
age = Date.today.year - self.birthday.year
if Date.today < self.birthday.advance(:years => age)
age -= 1
end
return age
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment