Sha256: e028c9cf4048da1c047df2ea872ea9f772834195cea10cb235aa719bad37d2fc

Contents?: true

Size: 470 Bytes

Versions: 16

Compression:

Stored size: 470 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module CsvCensus
      module Admin
        # A form to temporaly 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

16 entries across 16 versions & 1 rubygems

Version Path
decidim-verifications-0.28.4 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.9 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.28.3 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.8 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.28.2 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.7 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.28.1 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.6 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.28.0 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.5 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.28.0.rc5 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.28.0.rc4 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.4 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.3 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.2 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
decidim-verifications-0.27.1 app/forms/decidim/verifications/csv_census/admin/census_data_form.rb