Remove commentable functionality from photos

This is not (and as far as I know, was never) used. If we want to make
standalone photos commentable, we can always add it back, but it would
also need to change federation for it to work, because comments support
only posts there. But for now it makes the code cleaner and easier to
remove it.
This commit is contained in:
Benjamin Neff 2019-07-02 01:50:36 +02:00
parent e92eb88782
commit 034d78e3e4
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
2 changed files with 14 additions and 1 deletions

View file

@ -6,7 +6,6 @@
class Photo < ApplicationRecord
include Diaspora::Federated::Base
include Diaspora::Commentable
include Diaspora::Shareable
# NOTE API V1 to be extracted

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
class PhotosRemoveCommentCount < ActiveRecord::Migration[5.1]
class Comment < ApplicationRecord
end
def change
remove_column :photos, :comments_count, :integer
reversible do |change|
change.up { Comment.where(commentable_type: "Photo").delete_all }
end
end
end