Mikado wraps Activerecord validation conditions with a block.
Mikado has been tested with ruby 1.8/1.9 and ActiveRecord >= 2.3.5
Example:
Instead of
class Item < ActiveRecord::Base
validates_presence_of :title, :if => :live?
def live?
true
end
end
you can write like this
class Item < ActiveRecord::Base
include Mikado
mikado :live? do
validates_presence_of :title
end
def live?
true
end
end
Currently mikado only supports the :if condition. You can help yourself, just negate the condition value.
It supports all validations with name validates_* It also supports the methods validate, validate_on_create, validate_on_update and validate_each