-
-
Notifications
You must be signed in to change notification settings - Fork 0
zirni/mikado
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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_eachAbout
Mikado wraps Activerecord validation conditions with a block.
Resources
Code of conduct
Contributing
Security policy
Stars
Watchers
Forks
Sponsor this project
Packages 0
No packages published