Sha256: b8f3bbf5a3085a9d526511af3b17e79fcc66db0a1fb630daa23bcd2021165c08

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 Bytes

Contents

require 'has_settings/setting'
require 'has_settings/active_record_extension'
require 'has_settings/has_settings_helper'

module HasSettings
  def self.ensure_settings_class(owner_class)
    const_name = "#{owner_class.name}Settings".to_sym
    unless Object.const_defined?(const_name)
      settings_class = Object.const_set(const_name, Class.new(HasSettings::Setting))
      settings_class.owner_class = owner_class
    end
    Object.const_get(const_name)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
has_settings-0.0.1 lib/has_settings.rb