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.23.6 lib/decidim/data_portability.rb
decidim-core-0.24.2 lib/decidim/data_portability.rb
decidim-core-0.23.5 lib/decidim/data_portability.rb
decidim-core-0.24.1 lib/decidim/data_portability.rb
decidim-core-0.24.0 lib/decidim/data_portability.rb
decidim-core-0.24.0.rc2 lib/decidim/data_portability.rb
decidim-core-0.23.4 lib/decidim/data_portability.rb
decidim-core-0.24.0.rc1 lib/decidim/data_portability.rb
decidim-core-0.23.3 lib/decidim/data_portability.rb
decidim-core-0.23.2 lib/decidim/data_portability.rb
decidim-core-0.23.1 lib/decidim/data_portability.rb
decidim-core-0.23.1.rc1 lib/decidim/data_portability.rb
decidim-core-0.23.0 lib/decidim/data_portability.rb
decidim-core-0.22.0 lib/decidim/data_portability.rb
decidim-core-0.21.0 lib/decidim/data_portability.rb
decidim-core-0.20.1 lib/decidim/data_portability.rb
decidim-core-0.20.0 lib/decidim/data_portability.rb
decidim-core-0.19.1 lib/decidim/data_portability.rb
decidim-core-0.18.1 lib/decidim/data_portability.rb
decidim-core-0.19.0 lib/decidim/data_portability.rb