Skip to content

Instantly share code, notes, and snippets.

@pepetox
Created December 6, 2014 10:40
Show Gist options
  • Save pepetox/3fa6c8f37328f3abe798 to your computer and use it in GitHub Desktop.
Save pepetox/3fa6c8f37328f3abe798 to your computer and use it in GitHub Desktop.
Rails default value in a model
after_initialize :mimetodo
def mimeotdo
self.atributo ||= 0.0 #seting default
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment