lib/cantango/ability/engine_helpers.rb in cantango-0.9.3.2 vs lib/cantango/ability/engine_helpers.rb in cantango-0.9.4

- old
+ new

@@ -1,9 +1,12 @@ module CanTango class Ability module EngineHelpers def execute_engines! - each_engine {|engine| engine.new(self).execute! if engine } + each_engine do |engine| + engine_rules = engine.new(self).execute! if engine + @rules << engine_rules if !engine_rules.blank? + end end def each_engine &block engines.execution_order.each do |name| yield engines.registered[name] if engines.active? name