Sha256: 41d38a7baead4d2de646528b9967711016799283a1c861e62f13030680625a02
Contents?: true
Size: 629 Bytes
Versions: 79
Compression:
Stored size: 629 Bytes
Contents
# frozen_string_literal: true class FixUserFollows < ActiveRecord::Migration[5.2] class Follow < ApplicationRecord self.table_name = "decidim_follows" belongs_to :followable, foreign_key: "decidim_followable_id", foreign_type: "decidim_followable_type", polymorphic: true belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User" end def change # rubocop:disable Rails/SkipsModelValidations Follow.where( decidim_followable_type: "Decidim::User" ).update_all(decidim_followable_type: "Decidim::UserBaseEntity") # rubocop:enable Rails/SkipsModelValidations end end
Version data entries
79 entries across 79 versions & 1 rubygems