Skip to content

Instantly share code, notes, and snippets.

@thomasmarren
Created November 1, 2016 12:43
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 thomasmarren/2178f418e894791b8e26f91e0f0a5351 to your computer and use it in GitHub Desktop.
Save thomasmarren/2178f418e894791b8e26f91e0f0a5351 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
after_initialize :starting_balance
def starting_balance
self.balance ||= 100
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment