From d1f7d17ef5a387c5b76d5eedd41ce6641d3cd0dc Mon Sep 17 00:00:00 2001 From: 2458773093 <2458773093@protonmail.com> Date: Wed, 11 Sep 2019 17:21:29 +0300 Subject: [PATCH] new revision model --- app/models/status.rb | 2 ++ app/models/status_revision.rb | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 app/models/status_revision.rb diff --git a/app/models/status.rb b/app/models/status.rb index 57b1c694..85aaf7e4 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -24,6 +24,7 @@ # poll_id :bigint(8) # group_id :integer # quote_of_id :bigint(8) +# revised_at :datetime # class Status < ApplicationRecord @@ -61,6 +62,7 @@ class Status < ApplicationRecord has_many :mentions, dependent: :destroy, inverse_of: :status has_many :active_mentions, -> { active }, class_name: 'Mention', inverse_of: :status has_many :media_attachments, dependent: :nullify + has_many :revisions, class_name: 'StatusRevision', dependent: :destroy has_and_belongs_to_many :tags has_and_belongs_to_many :preview_cards diff --git a/app/models/status_revision.rb b/app/models/status_revision.rb new file mode 100644 index 00000000..62004c54 --- /dev/null +++ b/app/models/status_revision.rb @@ -0,0 +1,13 @@ +# == Schema Information +# +# Table name: status_revisions +# +# id :bigint(8) not null, primary key +# status_id :bigint(8) +# text :string +# created_at :datetime not null +# updated_at :datetime not null +# + +class StatusRevision < ApplicationRecord +end