icalendar/icalendar — pull request #101 by tdg5 (2014-12-02 18:52:12+00:00)
Title: Override ActiveSupport::TimeWithZone#to_a to fix multi_property

Ran into an issue today where a `Icalendar::Values::DateTime` that was delegating for an `ActiveSupport::TimeWithZone` was doing strange things when given as the argument to `Event#rdate=`.

The problem stemmed from the fact that `ActiveSupport::TimeWithZone` implements a `to_a` method that was implicitly being called from the `rdate=` `multi_property` setter by `Kernel#Array`. This was causing the `to_ical` method on an `Event` to die because it was trying to call `to_ical` on all of the elements of the Array returned by `ActiveSupport::TimeWithZone#to_a` which looks like this:
```ruby
DateTime.parse('20140130T230000Z').in_time_zone('UTC').to_a
# => [0, 0, 23, 30, 1, 2014, 4, 30, false, 'UTC']
```

This approach feels kind of hackish, but given the delegation that's going on, I couldn't come up with a better idea to fix the problem. Given that this solution is kind of unintuitive, I tried to add a big comment to explain what was going on. If you have a better idea, let me know and I can look into implementing it.