WIP: Karol's implementation #1

Closed
stan wants to merge 23 commits from karol_master into master
2 changed files with 5 additions and 0 deletions
Showing only changes of commit 5095f63fd7 - Show all commits

View file

@ -1,2 +1,4 @@
class Author < ApplicationRecord class Author < ApplicationRecord
validates :first_name, presence: true
validates :last_name, presence: true
end end

View file

@ -2,4 +2,7 @@ class Book < ApplicationRecord
has_and_belongs_to_many :authors has_and_belongs_to_many :authors
scope :published, -> { where(published: true) } scope :published, -> { where(published: true) }
validates :title, presence: true
validates :price, presence: true
validates :published, presence: true
end end