fluentd-ui/app/models/concerns/fluentd/setting/section_validator.rb
Kenji Okimoto 4f2a06fd82
Add concerns to define models for fluent-plugin
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
2018-05-24 18:08:33 +09:00

22 lines
462 B
Ruby

class Fluentd
module Setting
module SectionValidator
extend ActiveSupport::Concern
included do
validate :validate_sections
end
def validate_sections
self._section_params.each do |name, sections|
sections.each do |section|
if section.invalid?
errors.add(name, :invalid, message: section.errors.full_messages)
end
end
end
end
end
end
end