I followed the Chris' excellent tutorial on Recurring events with the ice_cube gem. However, I was running into an issue when the value of
recurring was set to
- not recurring -. If I went to create or update an
event, I would get the following error:
undefined method 'to_hash' for nil:NilClass, which pointed to this line
The actual value of this field is
null, and for some reason this value was being accepted as a
I ended up rewriting my
recurring= method to the following to solve the issue.
def recurring=(value) if value == "null" super(nil) elsif RecurringSelect.is_valid_rule?(value) super(RecurringSelect.dirty_hash_to_rule(value).to_hash) else super(nil) end end
Join 30,005+ developers who get early access to new screencasts, articles, guides, updates, and more.