Ice Cube Rails problem

I'm using Ice_Cube to try and get the rule from a Model to be used to create a schedule, like so:

@temp_sched.add_recurrence_rule IceCube::Rule.from_yaml(Transaction.last.rule)

However this doesn't seem to be the right thing, I just want to create a new Rule using the rule specified for each Model. IceCube::Rule.new(the rule) would be a good way, but this doesn't seem to exist.

Anyone know of a good way to create a rule using an existing rule stored within a model?

Hey,

You can do:

rule = Rule.weekly rule_yaml = rule.to_yaml

schedule = Schedule.new(Time.now) schedule.add_recurrence_rule Rule.from_yaml(rule_yaml)

Is this not what you're looking for? Maybe a little clarification will help

Thanks, John Crepezzi