app/controllers/maestrano/synchronizations_controller.rb in maestrano-connector-rails-2.0.2.pre.RC10 vs app/controllers/maestrano/synchronizations_controller.rb in maestrano-connector-rails-2.0.2.pre.RC11
- old
+ new
@@ -17,10 +17,10 @@
organization = Maestrano::Connector::Rails::Organization.find_by(uid: uid, tenant: tenant)
return render json: {errors: [{message: 'Organization not found', code: 404}]}, status: :not_found unless organization
status = organization_status(organization)
- unless status == 'RUNNING' || status == 'ENQUEUED'
+ unless %w[RUNNING ENQUEUED].include?(status)
Maestrano::Connector::Rails::SynchronizationJob.perform_later(organization.id, opts.with_indifferent_access)
status = 'ENQUEUED'
end
render_organization_sync(organization, status, 201)