Which is the best way to have a draft version of a model? I have a Course model with his description and lesson models.
class Course < ApplicationRecord
has_many :lessons
has_one :description
...
end
class Description < ApplicationRecord
belongs_to :course
...
end
class Lesson < ApplicationRecord
belongs_to :course
...
end
The description and lesson model have a state machine with a "published" status, that when they have it, their information will be published. I need the draft version to modify their information without change the published information. How can I do this?
PD: I have tried to use the draftsman gem, but doesn't work with Rails 5.