Skip to content

Commit

Permalink
Stop settings DB queries
Browse files Browse the repository at this point in the history
  • Loading branch information
ShimShtein authored and adamruzicka committed Aug 10, 2022
1 parent eff9422 commit e257335
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/models/setting/rh_cloud.rb
@@ -1,16 +1,6 @@
class Setting::RhCloud < Setting
::Setting::BLANK_ATTRS.concat %w{rhc_instance_id}

def self.load_defaults
return false unless table_exists?
transaction do
# If the user had auto_upload default setting, we will not surprise him, and force the value to false
# for new users, the default will be set to true and the value will remain nil
Setting.where(name: 'allow_auto_inventory_upload', value: nil).where("settings.default LIKE '%false%'").update_all(value: "--- false\n...")
super
end
end

def self.default_settings
[
set('allow_auto_inventory_upload', N_('Enable automatic upload of your host inventory to the Red Hat cloud'), true, N_('Automatic inventory upload')),
Expand Down

0 comments on commit e257335

Please sign in to comment.