Methods

Class/Module Index [+]

Quicksearch

Sequel::Plugins::ErrorSplitter::InstanceMethods

Public Instance Methods

_valid?(*) click to toggle source

If the model instance is not valid, go through all of the errors entries. For any that apply to multiple columns, remove them and add separate error entries, one per column.

# File lib/sequel/plugins/error_splitter.rb, line 36
def _valid?(*)
  v = super
  unless v
    errors.keys.select{|k| k.is_a?(Array)}.each do |ks|
      msgs = errors.delete(ks)
      ks.each do |k|
        msgs.each do |msg|
          errors.add(k, msg)
        end
      end
    end
  end
  v
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.