Skip to content

Instantly share code, notes, and snippets.

@ilyakrasnov
Forked from kenmazaika/game.rb
Created November 19, 2017 07:13
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 ilyakrasnov/c82a2d4e3cb549edaedf5b9ee47c712c to your computer and use it in GitHub Desktop.
Save ilyakrasnov/c82a2d4e3cb549edaedf5b9ee47c712c to your computer and use it in GitHub Desktop.
Populate the Board of a Chess Game
class Game < ActiveRecord::Base
# all the associations, etc.
after_create :populate_board!
def populate_board!
# this should create all 32 pieces with their initial X/Y coordinates.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment