palkan/anyway_config

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

louim opened this issue · 1 comments

louim commented

What did you do?

  • Installed the Gem
  • used the generator
  • added two keys to test
  • used env_prefix "" like suggested in #118
  • Opened a rails c
  • Typed ApplicationConfig.new

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

Thanks for the report. Fixed