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