Sha256: 4410b1b769dc9cb16648762fce99f2dea2646c33377807f7ac400ee7f406df1c

Contents?: true

Size: 435 Bytes

Versions: 4

Compression:

Stored size: 435 Bytes

Contents

# frozen_string_literal: true

module Lcms
  module Engine
    class Settings < ActiveRecord::Base
      class << self
        def [](key)
          settings.data[key.to_s]
        end

        def []=(key, value)
          settings.update data: settings.data.merge(key.to_s => value)
        end

        private

        def settings
          last || create!(data: { editing_enabled: true })
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lcms-engine-0.1.4 app/models/lcms/engine/settings.rb
lcms-engine-0.1.3 app/models/lcms/engine/settings.rb
lcms-engine-0.1.2 app/models/lcms/engine/settings.rb
lcms-engine-0.1.0 app/models/lcms/engine/settings.rb