Sha256: 59a08bc593b0c2fe078f3544000971b1c0be48ab7022fd5d26440702bf90aeb3

Contents?: true

Size: 472 Bytes

Versions: 6

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module CsvCensus
      module Admin
        # A form to temporarily upload csv census data
        class CensusDataForm < Form
          mimic :census_data

          attribute :file

          def data
            CsvCensus::Data.new(file.path)
          rescue CSV::MalformedCSVError
            errors.add(:file, :malformed)

            nil
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-verifications-0.29.1 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.29.0 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.29.0.rc4 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.29.0.rc3 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.29.0.rc2 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.29.0.rc1 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb