title: rails_admin searchable association
body: <p>I am using rails_admin together with globalize3 and cannot get searchable associations to work. Here are the models (Person has_one/belongs_to Name has_many/belongs_to NameTranslation):</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
    has_one :name, inverse_of: :person
  end
  
  class Name &lt; ActiveRecord::Base
    belongs_to :person, inverse_of: :name
    translates :first_name, :last_name
    has_many :name_translations, inverse_of: :name, dependent: :destroy
  end
  
  class NameTranslation &lt; ActiveRecord::Base
    belongs_to :name, inverse_of: :name_translations      
  end
  </code></pre>
  
  <p>The <code>NameTranslation</code> model is coming from globalize3, it contains the same attributes as name (<code>first_name</code> and <code>last_name</code>) plus <code>locale</code> and <code>name_id</code>,.</p>
  
  <p>In <code>config/initializers/rails_admin.rb</code> I have</p>
  
  <pre><code>config.model Person do
    list do
      field :name do
        searchable name_translations: :last_name
      end
    end
  end
  </code></pre>
  
  <p>Then, in the GUI, when I add a filter on <code>name</code>, I get:</p>
  
  <pre><code>SQLite3::SQLException: no such column: name_translations.last_name: SELECT  "people".* FROM "people"  WHERE (((name_translations.last_name LIKE '%freud%'))) ORDER BY people.id desc LIMIT 20 OFFSET 0
  </code></pre>
  
  <p>Obviously, rails_admin is looking for a column named <code>name_translations.last_name</code> in <code>people</code> instead of joining/including <code>names</code> and <code>name_translations</code> - why?</p>
  
  <p>What I need rails_admin to do is this, working in irb:</p>
  
  <pre><code>&gt;&gt; Person.joins( name: :name_translations ).where('name_translations.last_name like "test"')
  </code></pre>
  
  <p>which generates the following SQL:</p>
  
  <pre><code>SELECT "people".* FROM "people" INNER JOIN "names" ON "names"."person_id" = "people"."id" INNER JOIN "name_translations" ON "name_translations"."name_id" = "names"."id" WHERE (name_translations.last_name like "test")
  </code></pre>
  
  <p>Can this be done in rails_admin? Thanks for your help...</p>