validate_with?

12 views
Skip to first unread message

Arlen Walker

unread,
Nov 19, 2014, 11:21:56 PM11/19/14
to radiant...@googlegroups.com
Only seen validates_with, not validate_with, and it was just used with classes and not a block, and the tests in lib/radiant/config/definition_spec.rb that use it are failing:

    @validating = Radiant::Config::Definition.new({
      :default => "Monkey",
      :validate_with => lambda {|s| s.errors.add(:value, "That's no monkey") unless s.value == "Monkey" }
    })

I suspected it translates to :validate, as that can accept a block in 3.2, but no dice. Any ideas? Do I need to do the class_eval dance with this to add the validation?
Reply all
Reply to author
Forward
0 new messages