Commit 4653f08c80d9c3be1b59b63a5470b92366a0fdec
1 parent
80eda153
Exists in
master
and in
22 other branches
Check if table exists before try to use it in the Rails initializers
Showing
2 changed files
with
8 additions
and
4 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 | ... | ... |
config/initializers/person_notification.rb