Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'skinny' of github.com:mattmacleod/Braincube into skinny

  • Loading branch information...
commit 5f2d2b02b93d0021c2e9eb9b76fd4f44260ecc95 2 parents cc608cb + 2a870e9
@mattmacleod authored
View
10 app/models/imported_performance.rb
@@ -85,11 +85,17 @@ def create_from_csv!( csv_data )
event = Event.find_by_title( data[:event_name] )
city = City.find_by_name(data[:city]) || City.first
venue = Venue.find(:first, :conditions => { :title => data[:venue_name], :city_id => city.id})
- start_at = Time::parse( "#{data[:start_date]} #{data[:start_time]}") rescue nil
- end_at = Time::parse( "#{data[:end_date]} #{data[:end_time]}" ) rescue nil
+ start_at = Time::parse( "#{data[:start_date]} #{data[:start_time]}").getlocal rescue nil
+ end_at = Time::parse( "#{data[:end_date]} #{data[:end_time]}" ).getlocal rescue nil
end_at = (end_at + 1.day) if end_at && start_at && (end_at < start_at)
+ # Bit of a hack to account for DST
+ if start_at.dst?
+ start_at += 1.hour
+ end_at += 1.hour if end_at
+ end
+
imported_attributes = {
:event_name => data[:event_name],
:event => event,
View
1  test/functional/admin_controller_test.rb
@@ -44,7 +44,6 @@ class AdminControllerTest < ActionController::TestCase
should_require_admin_login
end
-
# Logging in/out
##############################
Please sign in to comment.
Something went wrong with that request. Please try again.