Created
March 12, 2020 05:15
-
-
Save elct9620/4eae938df60b6d9e41aa7183cdb45cf7 to your computer and use it in GitHub Desktop.
Simple settings model for Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "singleton" | |
class Settings | |
include Singleton | |
class << self | |
delegate_missing_to :instance | |
end | |
delegate_missing_to :@config | |
def initialize | |
@config = Rails.application.config_for(:settings) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment