Permalink
Browse files

Merge branch 'development' of github.com:zero-labs/radia-source into …

…development
  • Loading branch information...
Daniel Zacarias
Daniel Zacarias committed Apr 21, 2011
2 parents 75b9f7c + c4ecd9c commit 646c758467b495f4552d48fce34c52721559e67e
@@ -34,8 +34,8 @@ def update
dtend = ProgramSchedule.get_datetime(params["new_schedule"]["end"])
j = Jobs::ScheduleDownloadAndMergeJob.new(:dtend => dtend)
- j.perform #sync
- #Delayed::Job.enqueue(j) # TODO change to async
+ #j.perform #sync
+ Delayed::Job.enqueue(j) # TODO change to async
flash[:notice] = "The schedule is being updated"
redirect_to :action => 'show'
@@ -1,3 +1,2 @@
class OperationLog < ActiveRecord::Base
- symbolize :status
end
@@ -1,3 +1,3 @@
class ScheduleUpdateLog < OperationLog
- validates_inclusion_of :status, :in => [:initializing, :downloading, :parsing, :processing, :persisting, :completed, :failed]
+ symbolize :status, :in => [:initialized, :downloading, :parsing, :processing, :persisting, :completed, :failed]
end
@@ -48,7 +48,6 @@ def perform
log.operation_errors = e.to_operation_log_msg
puts e
puts e.backtrace
- return false
ensure
log.dtend = Time.now;
log.save!
@@ -123,7 +123,7 @@ def self.load_calendars(templates, filenames = {})
end
if not errors.empty?
- raise CalendarFetchFailedException errors
+ raise CalendarFetchFailedException.new(errors)
end
return { :originals => originals, :repetitions => repetitions }
@@ -17,6 +17,11 @@ def test_status_can_be_saved_as_string
:dtstart => Time.now,
:dtend => 1.hour.from_now,
:operation_errors => 'Messages')
- assert op.save
+ assert op.save
+ end
+
+ def test_status_create!
+ assert = OperationLog.create!(:status => 'initializing',
+ :dtstart => Time.now)
end
end

0 comments on commit 646c758

Please sign in to comment.