List view question: has_many through relationship searchable

184 views
Skip to first unread message

Walksalong

unread,
Mar 8, 2012, 4:48:25 PM3/8/12
to rails...@googlegroups.com
Hello,

has_many :person_programs
has_many :programs, :through => :person_programs

I'd like to search for programs on the people list page.

https://github.com/sferik/rails_admin/wiki/List describes belongs_to searches, but I couldn't find anything for has_many.

config.model Person do
list do
field :programs do
       #tried this
        searchable [{:programs => :name}, {:programs => :id}]
      end
end

Thanks!




Benoit Bénézech

unread,
Mar 9, 2012, 5:50:59 AM3/9/12
to rails...@googlegroups.com
has_many are not added to the include for perf reason. That means that AR won't find the :programs table.

Mark Silverberg

unread,
Oct 21, 2013, 10:24:20 AM10/21/13
to rails...@googlegroups.com
any suggestions on how to patch so that has_many are included?
Reply all
Reply to author
Forward
0 new messages