Module: ValidationsStepFu::Definition::InstanceMethods

Defined in:
lib/validations_step_fu.rb

Instance Method Summary collapse

Instance Method Details

#define_step_validation(name, *attrs) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/validations_step_fu.rb', line 7

def define_step_validation(name, *attrs)
  define_method "valid_step_#{name}?" do
    self.errors.clear
    validates_step_by(*attrs)
    self.errors.empty?
  end
end