Class: PactBroker::Config::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/config/repository.rb

Instance Method Summary collapse

Instance Method Details

#class_supported?(setting_value) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/pact_broker/config/repository.rb', line 11

def class_supported?(setting_value)
  !!Setting.get_db_type(setting_value)
end

#create_or_update_setting(setting_name, setting_value) ⇒ Object



6
7
8
9
# File 'lib/pact_broker/config/repository.rb', line 6

def create_or_update_setting(setting_name, setting_value)
  setting = Setting.find(name: setting_name.to_s) || Setting.new(name: setting_name.to_s)
  setting.set_value_from(setting_value).save
end