Sha256: e0104a7b4cc1acc5ecfcccc8c20f956c675c9e0bb8ce073c4d19e977dcd44ba1

Contents?: true

Size: 1017 Bytes

Versions: 18

Compression:

Stored size: 1017 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Census
      class Dataset < ApplicationRecord
        include Traceable
        include Loggable

        # The data store for a whole Census for a voting.
        belongs_to :voting, foreign_key: :decidim_votings_voting_id,
                            class_name: "Decidim::Votings::Voting"
        has_many :data,
                 foreign_key: "decidim_votings_census_dataset_id",
                 class_name: "Decidim::Votings::Census::Datum",
                 dependent: :destroy

        has_one_attached :access_codes_file

        delegate :organization, to: :voting

        enum status: [:init_data, :creating_data, :data_created, :generating_codes, :codes_generated, :exporting_codes, :freeze]

        validates :filename, presence: true

        alias participatory_space voting

        def self.log_presenter_class_for(_log)
          Decidim::Votings::Census::AdminLog::DatasetPresenter
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.9 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.28.3 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.8 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.28.2 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.7 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.28.1 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.6 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.28.0 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.5 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.28.0.rc5 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.28.0.rc4 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.4 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.3 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.2 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.1 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.0 app/models/decidim/votings/census/dataset.rb
decidim-elections-0.27.0.rc2 app/models/decidim/votings/census/dataset.rb