diff --git a/app/models/communication/website/post.rb b/app/models/communication/website/post.rb index e7d4f38837556509c24bec9df7d5ddd4ea9c1a98..a3211613cf529142bd1a68131e0afd5614156e99 100644 --- a/app/models/communication/website/post.rb +++ b/app/models/communication/website/post.rb @@ -4,10 +4,10 @@ # # id :uuid not null, primary key # description :text +# old_text :text # published :boolean default(FALSE) # published_at :datetime # slug :text -# text :text # title :string # created_at :datetime not null # updated_at :datetime not null @@ -27,6 +27,8 @@ class Communication::Website::Post < ApplicationRecord include WithSlug + has_rich_text :text + belongs_to :university belongs_to :website, foreign_key: :communication_website_id diff --git a/app/views/admin/communication/website/posts/_form.html.erb b/app/views/admin/communication/website/posts/_form.html.erb index a55a613a0e324b28eb8aa0772b13f04b70888383..3bf62603ef38e6905409c09c8d955f10ac110456 100644 --- a/app/views/admin/communication/website/posts/_form.html.erb +++ b/app/views/admin/communication/website/posts/_form.html.erb @@ -7,8 +7,8 @@ </div> <div class="card-body"> <%= f.input :title %> - <%= f.input :description, as: :trix_editor %> - <%= f.input :text, as: :trix_editor %> + <%= f.input :description %> + <%= f.input :text, as: :rich_text_area %> </div> </div> </div> diff --git a/db/migrate/20211021095157_rename_text_in_communication_website_posts.rb b/db/migrate/20211021095157_rename_text_in_communication_website_posts.rb new file mode 100644 index 0000000000000000000000000000000000000000..da1a018468e54a2246f1b0343602c5c8c150a1c4 --- /dev/null +++ b/db/migrate/20211021095157_rename_text_in_communication_website_posts.rb @@ -0,0 +1,5 @@ +class RenameTextInCommunicationWebsitePosts < ActiveRecord::Migration[6.1] + def change + rename_column :communication_website_posts, :text, :old_text + end +end diff --git a/db/schema.rb b/db/schema.rb index bb4be990c1026ec5e143e9ad9659da38c4033190..fe55fba23f5b3c313d09a2c235b4ad82c734d0d6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_10_21_093238) do +ActiveRecord::Schema.define(version: 2021_10_21_095157) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -175,7 +175,7 @@ ActiveRecord::Schema.define(version: 2021_10_21_093238) do t.uuid "communication_website_id", null: false t.string "title" t.text "description" - t.text "text" + t.text "old_text" t.boolean "published", default: false t.datetime "published_at" t.datetime "created_at", precision: 6, null: false