2 ms·
Hey thanks for all your answers to far! Here's what I've been working with (sorry if this only makes sense to Rails folks--ask me about a certain section, and I
by adelevie 16y ago
Hey thanks for all your answers to far!
Here's what I've been working with (sorry if this only makes sense to Rails folks--ask me about a certain section, and I'll try to clarify to non-Rails people as best I can):
-A ruby gem called rools
-sample rule:
rule 'foo' do
parameter SomeObject
condition { some_object.attribute == 'something_else' }
consequence { some_object.change_state! }
end
-inside of the application_controller, I run a before_filter with this code:
rules = Rools:RuleSet.new 'path/to/file/that/has/rules.rb'
so = SomeObject.find(:first)
rules.assert so