Sha256: a4675b3ee0c4861f3ea85e04ab7c0bcc5613bbb33fd2fba7949a31ae6409601c

Contents?: true

Size: 842 Bytes

Versions: 49

Compression:

Stored size: 842 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  # This concern contains the logic related to data portability.
  module DataPortability
    extend ActiveSupport::Concern

    included do
      # Returns a collection scoped by user.
      # This is the default, if you want, you can overwrite in each Class to be export.
      def self.user_collection(user)
        return unless user.is_a?(Decidim::User)

        where(decidim_author_id: user.id, decidim_author_type: "Decidim::UserBaseEntity")
      end

      # Returns a Default export serializer
      def self.export_serializer
        Decidim::Exporters::Serializer
      end

      # Returns a collection of images scoped by User.
      # Returns nil for default.
      def self.data_portability_images(_user)
        nil
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
decidim-core-0.26.10 lib/decidim/data_portability.rb
decidim-core-0.26.9 lib/decidim/data_portability.rb
decidim-core-0.26.8 lib/decidim/data_portability.rb
decidim-core-0.26.7 lib/decidim/data_portability.rb
decidim-core-0.26.5 lib/decidim/data_portability.rb
decidim-core-0.26.4 lib/decidim/data_portability.rb
decidim-core-0.26.3 lib/decidim/data_portability.rb
decidim-core-0.26.2 lib/decidim/data_portability.rb
decidim-core-0.26.1 lib/decidim/data_portability.rb
decidim-core-0.26.0 lib/decidim/data_portability.rb
decidim-core-0.26.0.rc2 lib/decidim/data_portability.rb
decidim-core-0.26.0.rc1 lib/decidim/data_portability.rb
decidim-core-0.25.2 lib/decidim/data_portability.rb
decidim-core-0.25.1 lib/decidim/data_portability.rb
decidim-core-0.25.0 lib/decidim/data_portability.rb
decidim-core-0.25.0.rc4 lib/decidim/data_portability.rb
decidim-core-0.25.0.rc3 lib/decidim/data_portability.rb
decidim-core-0.25.0.rc2 lib/decidim/data_portability.rb
decidim-core-0.25.0.rc1 lib/decidim/data_portability.rb
decidim-core-0.24.3 lib/decidim/data_portability.rb