Skip to content

Commit

Permalink
Merge pull request #24 from Knightster/piece-model
Browse files Browse the repository at this point in the history
Created Piece model
  • Loading branch information
zaynrahn authored Jul 19, 2017
2 parents aa98c20 + 921e2aa commit f41d38e
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/bishop.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Bishop < Piece
end
2 changes: 2 additions & 0 deletions app/models/king.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class King < Piece
end
2 changes: 2 additions & 0 deletions app/models/knight.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Knight < Piece
end
2 changes: 2 additions & 0 deletions app/models/piece.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Piece < ApplicationRecord
end
15 changes: 15 additions & 0 deletions db/migrate/20170719014442_create_pieces.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class CreatePieces < ActiveRecord::Migration[5.0]
def change
create_table :pieces do |t|
t.string :type
t.string :color
t.integer :x_position
t.integer :y_position
t.integer :game_id
t.integer :user_id
t.boolean :captured

t.timestamps
end
end
end
11 changes: 11 additions & 0 deletions test/fixtures/bishops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/kings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/knights.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/pieces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
7 changes: 7 additions & 0 deletions test/models/bishop_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class BishopTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/models/king_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class KingTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/models/knight_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class KnightTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/models/piece_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class PieceTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit f41d38e

Please sign in to comment.