Commit 905ae96c0760b98c660f685d55b31b5b9b69a223
Committed by
Rodrigo Souto
1 parent
9255fbad
Exists in
master
and in
29 other branches
Check if table exists before try to use it in the Rails initializers
Conflicts: config/initializers/person_notification.rb
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
config/initializers/activities_counter_cache.rb
1 | -job = Delayed::Backend::ActiveRecord::Job.all :conditions => ['handler LIKE ?', "%ActivitiesCounterCacheJob%"] | |
2 | -if job.blank? | |
3 | - Delayed::Backend::ActiveRecord::Job.enqueue(ActivitiesCounterCacheJob.new, -3) | |
1 | +if Delayed::Backend::ActiveRecord::Job.table_exists? | |
2 | + job = Delayed::Backend::ActiveRecord::Job.all :conditions => ['handler LIKE ?', "%ActivitiesCounterCacheJob%"] | |
3 | + if job.blank? | |
4 | + Delayed::Backend::ActiveRecord::Job.enqueue(ActivitiesCounterCacheJob.new, -3) | |
5 | + end | |
4 | 6 | end | ... | ... |