Sha256: c6c1523bab89082379cbadb885e93e50b58e983ebfb35a487d0d527345f8896a

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

module LoadSettings
  extend ActiveSupport::Concern

  included do
    def load_settings
      @settings = SettingsObject.hash
      if @settings.empty?
        build_settings_defaults
        @settings = SettingsObject.hash
      end
    end

    def build_settings_defaults
      SettingsObject.create(title: "general", values: {
        website_title: "",
        website_tagline: "",
        website_description: "",
        website_logo_url: "",
        website_url: ""
      })
      SettingsObject.create(title: "styles", values: {
        css: ""
      })
      SettingsObject.create(title: "scripts", values: {
        javascript: ""
      })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
venice-chr-0.1.5 app/controllers/concerns/load_settings.rb