Module: Motor::Configs

Defined in:
lib/motor/configs.rb,
lib/motor/configs/write_to_file.rb,
lib/motor/configs/sync_from_file.rb,
lib/motor/configs/sync_from_hash.rb,
lib/motor/configs/load_from_cache.rb,
lib/motor/configs/sync_middleware.rb,
lib/motor/configs/build_ui_app_tag.rb,
lib/motor/configs/sync_with_remote.rb,
lib/motor/configs/build_configs_hash.rb

Defined Under Namespace

Modules: BuildConfigsHash, BuildUiAppTag, LoadFromCache, SyncFromFile, SyncFromHash, SyncWithRemote, WriteToFile Classes: SyncMiddleware

Constant Summary collapse

FILE_PATH =
'config/motor.yml'
SYNC_API_PATH =
'/motor_configs_sync'
SYNC_ACCESS_KEY =
ENV.fetch('MOTOR_SYNC_API_KEY', '')
WORKDIR_FILE_NAME =
'motor-admin.yml'

Class Method Summary collapse

Class Method Details

.clearObject



12
13
14
15
16
17
18
19
20
# File 'lib/motor/configs.rb', line 12

def clear
  Motor::Resource.destroy_all
  Motor::Alert.destroy_all
  Motor::Query.destroy_all
  Motor::Dashboard.destroy_all
  Motor::Form.destroy_all
  Motor::ApiConfig.destroy_all
  Motor::Config.destroy_all
end

.file_pathString

Returns:

  • (String)


23
24
25
26
27
28
29
# File 'lib/motor/configs.rb', line 23

def file_path
  if defined?(MotorAdmin::Application)
    [ENV['WORKDIR'], WORKDIR_FILE_NAME].compact.join('/')
  else
    Rails.root.join(FILE_PATH).to_s
  end
end