rails-settings icon indicating copy to clipboard operation
rails-settings copied to clipboard

autosave raising unknown key

Open baweaver opened this issue 9 years ago • 1 comments

https://github.com/ledermann/rails-settings/blob/57d95adcb9490767699cffcf75269b1961037d6d/lib/rails-settings/base.rb#L7

Exception: ArgumentError: Unknown key: :autosave. Valid keys are: :class_name, :class, :foreign_key, :validate, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type

--
 0: /my_gem_path/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/core_ext/hash/keys.rb:75:in `block in assert_valid_keys'
 1: /my_gem_path/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/core_ext/hash/keys.rb:73:in `each_key'
 2: /my_gem_path/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/core_ext/hash/keys.rb:73:in `assert_valid_keys'
 3: /my_gem_path/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/associations/builder/association.rb:82:in `validate_options'
 4: /my_gem_path/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/associations/builder/association.rb:62:in `initialize'
 5: /my_gem_path/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/associations/builder/collection_association.rb:18:in `initialize'
 6: /my_gem_path/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/associations/builder/association.rb:47:in `new'
 7: /my_gem_path/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/associations/builder/association.rb:47:in `create_builder'
 8: /my_gem_path/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/associations/builder/association.rb:35:in `build'
 9: /my_gem_path/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/associations.rb:1258:in `has_many'
10: /my_gem_path/ruby-2.1.2/gems/ledermann-rails-settings-2.4.0/lib/rails-settings/base.rb:5:in `block in included'
11: /my_gem_path/ruby-2.1.2/gems/ledermann-rails-settings-2.4.0/lib/rails-settings/base.rb:4:in `class_eval'
12: /my_gem_path/ruby-2.1.2/gems/ledermann-rails-settings-2.4.0/lib/rails-settings/base.rb:4:in `included'
13: /my_gem_path/ruby-2.1.2/gems/ledermann-rails-settings-2.4.0/lib/rails-settings.rb:10:in `include'
14: /my_gem_path/ruby-2.1.2/gems/ledermann-rails-settings-2.4.0/lib/rails-settings.rb:10:in `has_settings'

baweaver avatar Apr 25 '16 21:04 baweaver

I don't know what is going wrong here. The :autosave option for has_many is part of ActiveRecord for a long time, see here: https://github.com/rails/rails/blob/v4.2.0/activerecord/lib/active_record/autosave_association.rb

I can't reproduce your issue. The testsuite using Rails 4.2.0 is running fine. Can you give me some more hints to reproduce this?

ledermann avatar Apr 26 '16 11:04 ledermann