Skip to content

Commit

Permalink
Merge pull request icalendar#98 from jeremyevans/master
Browse files Browse the repository at this point in the history
Use more specific check for ActiveSupport timezone support
  • Loading branch information
rahearn committed Oct 23, 2014
2 parents 75b38be + e08db70 commit c9a0db5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/icalendar/values/time_with_zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module TimeWithZone
def initialize(value, params = {})
@tz_utc = params['tzid'] == 'UTC'

if defined?(ActiveSupport) && !params['tzid'].nil?
if defined?(ActiveSupport::TimeZone) && defined?(ActiveSupport::TimeWithZone) && !params['tzid'].nil?
tzid = params['tzid'].is_a?(::Array) ? params['tzid'].first : params['tzid']
zone = ActiveSupport::TimeZone[tzid]
value = ActiveSupport::TimeWithZone.new nil, zone, value unless zone.nil?
Expand Down

0 comments on commit c9a0db5

Please sign in to comment.