Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ignore errors on load to allow migration

  • Loading branch information...
commit bd15d674ebf36f9f12e57d51b97d35f1fbbbd5b7 1 parent dda319f
Ariel Salomon authored sideshowbandana committed
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/vanity/adapters/active_record_adapter.rb
View
12 lib/vanity/adapters/active_record_adapter.rb
@@ -148,10 +148,14 @@ def destroy_metric(metric)
# Store when experiment was created (do not write over existing value).
def set_experiment_created_at(experiment, time)
- record = VanityExperiment.find_by_experiment_id(experiment.to_s) ||
- VanityExperiment.new(:experiment_id => experiment.to_s)
- record.created_at ||= time
- record.save
+ begin
+ record = VanityExperiment.find_by_experiment_id(experiment.to_s) ||
+ VanityExperiment.new(:experiment_id => experiment.to_s)
+ record.created_at ||= time
+ record.save
+ rescue Exception => e
+ puts "Make sure Vanity migrations have been run, ignoring #{e}"
+ end
end
# Return when experiment was created.
Please sign in to comment.
Something went wrong with that request. Please try again.