sferik/rails_admin — Issue #995: Unknown key: inverse_of
Author: greendog
Created: 2012-02-21 12:42:57+00:00
State: open

I used this page https://github.com/sferik/rails_admin/wiki/Has-and-belongs-to-many-association

```ruby
class Company < ActiveRecord::Base
has_and_belongs_to_many :branches, :inverse_of => :companies

accepts_nested_attributes_for :branches, :allow_destroy => true

has_many :pictures, :as => :picturable, :order => :position, :dependent => :destroy, :inverse_of => :picturable
end
```

```ruby
class Branch < ActiveRecord::Base
acts_as_nested_set

has_and_belongs_to_many :companies, :inverse_of => :branches

has_many :pictures, :as => :picturable, :order => :position, :dependent => :destroy, :inverse_of => :picturable
end
```
I have the folowing:
http://localhost:3000/admin

```ruby
ArgumentError in RailsAdmin::MainController#index

Unknown key: inverse_of

Rails.root: /home/dev/projects/rails/cms
Application Trace | Framework Trace | Full Trace

activesupport (3.2.1) lib/active_support/core_ext/hash/keys.rb:44:in `assert_valid_keys'
activesupport (3.2.1) lib/active_support/core_ext/hash/keys.rb:43:in `each_key'
activesupport (3.2.1) lib/active_support/core_ext/hash/keys.rb:43:in `assert_valid_keys'
activerecord (3.2.1) lib/active_record/associations/builder/association.rb:33:in `validate_options'
activerecord (3.2.1) lib/active_record/associations/builder/association.rb:24:in `build'
activerecord (3.2.1) lib/active_record/associations/builder/collection_association.rb:23:in `build'
activerecord (3.2.1) lib/active_record/autosave_association.rb:139:in `build'
activerecord (3.2.1) lib/active_record/associations/builder/has_and_belongs_to_many.rb:8:in `build'
activerecord (3.2.1) lib/active_record/associations/builder/collection_association.rb:13:in `build'
activerecord (3.2.1) lib/active_record/associations.rb:1600:in `has_and_belongs_to_many'
app/models/branch.rb:4
activesupport (3.2.1) lib/active_support/dependencies.rb:469:in `load'
activesupport (3.2.1) lib/active_support/dependencies.rb:469:in `load_file'
activesupport (3.2.1) lib/active_support/dependencies.rb:639:in `new_constants_in'
activesupport (3.2.1) lib/active_support/dependencies.rb:468:in `load_file'
```