Sha256: 6892559b7c91aa7f8bdf22304e59e370a0232e62edf8e8f44e3fd7eaa1b88c21
Contents?: true
Size: 1.13 KB
Versions: 7
Compression:
Stored size: 1.13 KB
Contents
class HomeController < ApplicationController def index @organization = current_organization end def update organization = Maestrano::Connector::Rails::Organization.find_by_id(params[:id]) if organization && is_admin?(current_user, organization) old_sync_state = organization.sync_enabled organization.synchronized_entities.keys.each do |entity| organization.synchronized_entities[entity] = !!params["#{entity}"] end organization.sync_enabled = organization.synchronized_entities.values.any? organization.save if !old_sync_state Maestrano::Connector::Rails::SynchronizationJob.perform_later(organization, {}) flash[:info] = 'Congrats, you\'re all set up! Your data are now being synced' end end redirect_to(:back) end def synchronize if is_admin Maestrano::Connector::Rails::SynchronizationJob.perform_later(current_organization, (params['opts'] || {}).merge(forced: true)) flash[:info] = 'Synchronization requested' end redirect_to(:back) end def redirect_to_external redirect_to 'https://path/to/external/app' end end
Version data entries
7 entries across 7 versions & 1 rubygems