-
-
Save alexis/1204165 to your computer and use it in GitHub Desktop.
code4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include FactChecker | |
define_fact :festivals, :if => lambda{|o| o.festivals > 0} | |
define_fact :scenario, :if => :scenario? | |
define_fact :requiest => [:festivals, :scenario], :if => :equipment? | |
define_fact :members => :request, :if => lambda{|o| o.members > 0} | |
define_fact :basic_info => :request, :if => lambda{|o| o.name.present? && o.description.present?} | |
define_fact :submit => [:members, :basic_info], :if => :submitted? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you think this can be used as a short-cut alternative for positive predicate?
def_fact :f1 => :f2 do |f|
f.festivals > 0
end