-
-
Save ilyakrasnov/c82a2d4e3cb549edaedf5b9ee47c712c to your computer and use it in GitHub Desktop.
Populate the Board of a Chess Game
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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