Skip to content

Instantly share code, notes, and snippets.

@fedesoria
Created November 16, 2011 00:09
Show Gist options
  • Save fedesoria/1368836 to your computer and use it in GitHub Desktop.
Save fedesoria/1368836 to your computer and use it in GitHub Desktop.
class User
after_initialize :init
def init
self.number ||= 0.0 #will set the default value only if it's nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment