bundle install
id
primary key, title
text, and published
boolean columnscreate
command on repo#by_pk
to read records backupdate
comand on repo using by_pk
restriction#published
method in relationarticles
method in repository to ensure all query methods return only published articlesid
primary key and name
text columnauthor_id
foreign key to "articles" tablebelongs_to :author
association in "articles" relationauthor_id
attribute filledpublish(author, article)
in the articles repository that will use :create
changeset to create a new article, mark it as published and associate with the authorunpublish(article)
in the articles repository that will use :update
changeset to mark the article as not publishedmap_to