Sha256: cff8e98a0840df3ba46c7421ac9b7fce646c1eca7e256667e1c3184122c92dfa

Contents?: true

Size: 547 Bytes

Versions: 18

Compression:

Stored size: 547 Bytes

Contents

# Extensions to help during seeding of ThecoreSettings
module Thecore
  class Seed
    def self.save_setting ns, setting, value
      puts "Saving setting if nil #{ns}: #{setting} = #{value}"
      if ::Settings.ns(ns)[setting].blank?
        ::Settings.ns(ns)[setting] if value.blank?
        ::Settings.ns(ns)[setting] = value unless value.blank?
      end
    end

    def self.delete_setting ns, setting
      puts "Removing setting #{ns}: #{setting}"
      ThecoreSettings::Setting.where(ns: ns, key: setting).destroy_all
    end
  end
end
  

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
thecore_auth_commons-3.2.2 lib/thecore/seed.rb
thecore_auth_commons-3.2.1 lib/thecore/seed.rb
thecore_auth_commons-3.1.7 lib/thecore/seed.rb
thecore_auth_commons-3.1.5 lib/thecore/seed.rb
thecore_auth_commons-3.1.4 lib/thecore/seed.rb
thecore_auth_commons-3.1.3 lib/thecore/seed.rb
thecore_auth_commons-3.1.2 lib/thecore/seed.rb
thecore_auth_commons-3.1.1 lib/thecore/seed.rb
thecore_auth_commons-3.1.0 lib/thecore/seed.rb
thecore_auth_commons-3.0.13 lib/thecore/seed.rb
thecore_auth_commons-3.0.12 lib/thecore/seed.rb
thecore_auth_commons-3.0.11 lib/thecore/seed.rb
thecore_auth_commons-3.0.10 lib/thecore/seed.rb
thecore_auth_commons-3.0.9 lib/thecore/seed.rb
thecore_auth_commons-3.0.8 lib/thecore/seed.rb
thecore_auth_commons-3.0.7 lib/thecore/seed.rb
thecore_auth_commons-3.0.6 lib/thecore/seed.rb
thecore_auth_commons-3.0.5 lib/thecore/seed.rb