Add Language model and LanguageController

This commit is contained in:
maddiebaka
2023-10-24 23:47:01 -04:00
parent ed00e69a13
commit 206c4da31f
28 changed files with 298 additions and 18 deletions

View File

@@ -1,3 +1,4 @@
class Definition < ApplicationRecord
belongs_to :word
belongs_to :language
end

6
app/models/language.rb Normal file
View File

@@ -0,0 +1,6 @@
class Language < ApplicationRecord
has_many :definitions
has_many :part_of_speeches
validates_presence_of :name
end

View File

@@ -1,2 +1,3 @@
class PartOfSpeech < ApplicationRecord
belongs_to :language
end