Skip to content

Commit

Permalink
Removing quickpost (#461)
Browse files Browse the repository at this point in the history
* intial commit

* edited migration

* Fixed Lint

* added permissions to migration

* Fixed Lint

* Updated migration
  • Loading branch information
lodewiges authored Nov 21, 2024
1 parent d481402 commit 5470a10
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 160 deletions.
2 changes: 0 additions & 2 deletions app/controllers/v1/quickpost_messages_controller.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/jobs/user_archive_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def keep_entities # rubocop:disable Metrics/MethodLength
PhotoAlbum,
PhotoTag,
Poll,
QuickpostMessage,
Form::Form,
Form::Response,
Forum::Post,
Expand Down
14 changes: 0 additions & 14 deletions app/models/quickpost_message.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/policies/quickpost_message_policy.rb

This file was deleted.

17 changes: 0 additions & 17 deletions app/resources/v1/quickpost_message_resource.rb

This file was deleted.

1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
end
get 'users/me/nextcloud', to: 'users#nextcloud'

jsonapi_resources :quickpost_messages
jsonapi_resources :vacancies

namespace :debit do
Expand Down
10 changes: 10 additions & 0 deletions db/migrate/20241113091607_remove_quickpost.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class RemoveQuickpost < ActiveRecord::Migration[7.0]
def change
drop_table :quickpost_messages

Permission.find_by(name: 'quickpost_message.create')&.destroy
Permission.find_by(name: 'quickpost_message.read')&.destroy
Permission.find_by(name: 'quickpost_message.update')&.destroy
Permission.find_by(name: 'quickpost_message.destroy')&.destroy
end
end
15 changes: 2 additions & 13 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2024_10_27_103012) do
ActiveRecord::Schema[7.0].define(version: 2024_11_13_091607) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -474,18 +474,7 @@
t.index ["author_id"], name: "index_polls_on_author_id"
t.index ["form_id"], name: "index_polls_on_form_id"
end

create_table "quickpost_messages", id: :serial, force: :cascade do |t|
t.integer "author_id"
t.text "message"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.datetime "deleted_at", precision: nil
t.datetime "datetime", precision: nil
t.index ["datetime"], name: "index_quickpost_messages_on_datetime"
t.index ["deleted_at"], name: "index_quickpost_messages_on_deleted_at"
end

3
create_table "room_adverts", force: :cascade do |t|
t.string "house_name", null: false
t.string "contact", null: false
Expand Down
4 changes: 0 additions & 4 deletions db/seeds/content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
end
end

members.sample(80).each { |user| FactoryBot.create(:quickpost_message, author: user) }
# To ensure at least one user creating (more than) two quickpost messages
members.sample(30).each { |user| FactoryBot.create(:quickpost_message, author: user) }

members.sample(4).each do |user|
FactoryBot.create(:activity, author: user)
end
Expand Down
3 changes: 0 additions & 3 deletions db/seeds/permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def create_permissions(permission_map)
'photo' => %i[create read update destroy],
'photo_comment' => %i[create read update destroy],
'photo_tag' => %i[create read update destroy],
'quickpost_message' => %i[create read update destroy],
'room_advert' => %i[create read update destroy],
'stored_mail' => %i[read destroy],
'forum/category' => %i[create read update destroy],
Expand Down Expand Up @@ -76,7 +75,6 @@ def create_permissions(permission_map)
'photo' => %i[create read],
'photo_comment' => %i[create read],
'photo_tag' => %i[create read],
'quickpost_message' => %i[create read],
'room_advert' => %i[create read],
'forum/category' => %i[read],
'forum/thread' => %i[create read],
Expand Down Expand Up @@ -111,7 +109,6 @@ def create_permissions(permission_map)
'photo' => %i[read],
'photo_comment' => %i[create read],
'photo_tag' => %i[create read],
'quickpost_message' => %i[create read],
'room_advert' => %i[],
'forum/category' => %i[read],
'forum/thread' => %i[create read],
Expand Down
6 changes: 0 additions & 6 deletions spec/factories/quickpost_messages.rb

This file was deleted.

2 changes: 0 additions & 2 deletions spec/jobs/user_archive_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
create(:photo, uploader: user)
create(:photo_album, author: user)
create(:poll, author: user)
create(:quickpost_message, author: user)
create(:response, user:)
create(:form, author: user)
create(:post, author: user)
Expand All @@ -33,7 +32,6 @@
it { expect { job }.to change { Photo.last.uploader }.from(user).to(archive_user) }
it { expect { job }.to change { PhotoAlbum.last.author }.from(user).to(archive_user) }
it { expect { job }.to change { Poll.last.author }.from(user).to(archive_user) }
it { expect { job }.to change { QuickpostMessage.last.author }.from(user).to(archive_user) }
it { expect { job }.to change { Form::Response.last.user }.from(user).to(archive_user) }
it { expect { job }.to change { Form::Form.last.author }.from(user).to(archive_user) }
it { expect { job }.to change { Forum::Post.last.author }.from(user).to(archive_user) }
Expand Down
43 changes: 0 additions & 43 deletions spec/models/quickpost_message_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/requests/v1/quickpost_messages_controller/create_spec.rb

This file was deleted.

11 changes: 0 additions & 11 deletions spec/requests/v1/quickpost_messages_controller/destroy_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/requests/v1/quickpost_messages_controller/index_spec.rb

This file was deleted.

11 changes: 0 additions & 11 deletions spec/requests/v1/quickpost_messages_controller/show_spec.rb

This file was deleted.

0 comments on commit 5470a10

Please sign in to comment.