diff options
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/game.rb | 7 | ||||
-rw-r--r-- | activerecord/test/models/game_board.rb | 7 | ||||
-rw-r--r-- | activerecord/test/models/game_collection.rb | 5 | ||||
-rw-r--r-- | activerecord/test/models/game_owner.rb | 5 |
4 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/test/models/game.rb b/activerecord/test/models/game.rb new file mode 100644 index 0000000000..0c33075b12 --- /dev/null +++ b/activerecord/test/models/game.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class Game < ActiveRecord::Base + has_one :game_board + belongs_to :game_owner + belongs_to :game_collection +end diff --git a/activerecord/test/models/game_board.rb b/activerecord/test/models/game_board.rb new file mode 100644 index 0000000000..01d082eddb --- /dev/null +++ b/activerecord/test/models/game_board.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class GameBoard < ActiveRecord::Base + belongs_to :game + has_one :game_owner, through: :game + has_one :game_collection, through: :game +end diff --git a/activerecord/test/models/game_collection.rb b/activerecord/test/models/game_collection.rb new file mode 100644 index 0000000000..853876b0bd --- /dev/null +++ b/activerecord/test/models/game_collection.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class GameCollection < ActiveRecord::Base + has_many :games +end diff --git a/activerecord/test/models/game_owner.rb b/activerecord/test/models/game_owner.rb new file mode 100644 index 0000000000..82be3e75b2 --- /dev/null +++ b/activerecord/test/models/game_owner.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class GameOwner < ActiveRecord::Base + has_many :games +end |