Sha256: 3cfdaeb3dea201c7e0f11786f258ee4cdac26552eb6d73f6ca957de6e72f5712
Contents?: true
Size: 784 Bytes
Versions: 7
Compression:
Stored size: 784 Bytes
Contents
module ActiveModel module Validations module ClassMethods def validation_group(group, options={}, &block) raise "The validation_group method requires a block" unless block_given? unless include?(GroupedValidations) include GroupedValidations end self.validation_groups += [ group ] _define_group_validation_callbacks(group) options[:name] = group if block.arity == 1 @_current_validation_group = options.merge(:with_options => true) with_options(options.except(:name)) do |config| yield config end else @_current_validation_group = options yield end @_current_validation_group = nil end end end end
Version data entries
7 entries across 7 versions & 2 rubygems