Sha256: 85edec19ad27782f8306923aa3bf7e432e4422c16107d4e1369e147591aa1a1c

Contents?: true

Size: 780 Bytes

Versions: 7

Compression:

Stored size: 780 Bytes

Contents

require 'thecore_auth_commons'
require 'devise-i18n'
require 'http_accept_language'
require 'rails-i18n'
require 'thecore_settings'

require 'patches/thecore'

require 'roo'
require 'roo-xls'

require "thecore_backend_commons/engine"

module ThecoreBackendCommons
  # Your code goes here...
end

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

7 entries across 7 versions & 1 rubygems

Version Path
thecore_backend_commons-3.0.6 lib/thecore_backend_commons.rb
thecore_backend_commons-3.0.5 lib/thecore_backend_commons.rb
thecore_backend_commons-3.0.4 lib/thecore_backend_commons.rb
thecore_backend_commons-3.0.3 lib/thecore_backend_commons.rb
thecore_backend_commons-3.0.0 lib/thecore_backend_commons.rb
thecore_backend_commons-2.4.2 lib/thecore_backend_commons.rb
thecore_backend_commons-2.4.1 lib/thecore_backend_commons.rb