Add Language model and LanguageController
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
class Definition < ApplicationRecord
|
||||
belongs_to :word
|
||||
belongs_to :language
|
||||
end
|
||||
|
6
app/models/language.rb
Normal file
6
app/models/language.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Language < ApplicationRecord
|
||||
has_many :definitions
|
||||
has_many :part_of_speeches
|
||||
|
||||
validates_presence_of :name
|
||||
end
|
@@ -1,2 +1,3 @@
|
||||
class PartOfSpeech < ApplicationRecord
|
||||
belongs_to :language
|
||||
end
|
||||
|
Reference in New Issue
Block a user