Created
January 11, 2018 13:46
-
-
Save codenamev/94b062a6f0fe0bfea263e951725d15e8 to your computer and use it in GitHub Desktop.
Woofers Modelling
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 User < ApplicationRecord | |
has_many :dogs | |
end | |
class Dog < ApplicationRecord | |
belongs_to :user | |
end |
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 User < ApplicationRecord | |
has_many :dogs | |
has_many :dog_walkers | |
end | |
class Dog < ApplicationRecord | |
belongs_to :user | |
end | |
class DogWalker < ApplicationRecord | |
belongs_to :user | |
has_many :dogs | |
end | |
class Owner < Application Record | |
belongs_to :user | |
has_many :dogs, through: :user | |
end |
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 User < ApplicationRecord | |
has_many :dogs | |
has_many :dog_walkers | |
has_many :owners | |
has_many :dog_walkers | |
end | |
class Dog < ApplicationRecord | |
belongs_to :user | |
end | |
class DogWalker < ApplicationRecord | |
belongs_to :user | |
end | |
class Owner < Application Record | |
belongs_to :user | |
has_many :dogs, through: :user | |
end | |
class DogTrainer < ApplicationRecord | |
belong_to :user | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment