Sha256: b14229403227e7d4d4bf6b5c22db6fbabe541277af20b25bef5a48fa1bac2ccb
Contents?: true
Size: 785 Bytes
Versions: 4
Compression:
Stored size: 785 Bytes
Contents
# frozen_string_literal: true module Decidim module ReportingProposals # Exposes the proposal resource so users can view and create them. module ComponentValidatorOverride extend ActiveSupport::Concern included do # The actual validator method. It is called when ActiveRecord iterates # over all the validators. def validate_each(record, attribute, component) unless component record.errors.add(attribute, :blank) return end manifests = [options[:manifest].to_s] manifests << "reporting_proposals" if manifests.first == "proposals" record.errors.add(attribute, :invalid) unless component.manifest_name.to_s.in?(manifests) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems