palkan / anyway_config

Configuration library for Ruby gems and applications
MIT License
778 stars 52 forks source link

You can only merge into a :trace type, and this is :value when env_prefix "" #139

Closed louim closed 1 year ago

louim commented 1 year ago

What did you do?

What did you expect to happen?

Application config is loaded as expected.

What actually happened?

/Users/louis-michel.couture/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/anyway_config-2.5.3/lib/anyway/tracing.rb:64:in `merge!': You can only merge into a :trace type, and this is :value (ArgumentError)

Additional context

My generated class looks like this:

# frozen_string_literal: true

# Base class for application config classes
class ApplicationConfig < Anyway::Config
  class << self
    # Make it possible to access a singleton config instance
    # via class methods (i.e., without explicitly calling `instance`)
    delegate_missing_to :instance

    private

    # Returns a singleton config instance
    def instance
      @instance ||= new
    end
  end

  env_prefix ""

  attr_config(:aws_access_key_id, :aws_secret_access_key)
end

Environment

Ruby Version: 3.1.3

Framework Version (Rails, whatever): rails 6.1

Anyway Config Version: 2.5.3

palkan commented 1 year ago

Thanks for the report. Fixed