sferik/rails_admin — Issue #1020: undefined method `rails_admin_default_object_label_method' for []:ActiveRecord::Relation
Author: rgagnon
Created: 2012-03-01 03:00:06+00:00
State: open

Hello,

Firstly, thanks for the great gem.

Here is the issue I'm facing :

undefined method `rails_admin_default_object_label_method' for []:ActiveRecord::Relation
Extracted source (around line #11):

8: selected_id = selected.id
9: selected_name = selected.send(config.object_label_method)
10: else
11: selected_id = field.selected_id
12: selected_name = field.formatted_value
13: end
14:

My model in problem has a self-referential relationship here is :

class SectionTemplate < ActiveRecord::Base
belongs_to :parent, :class_name => "SectionTemplate"
has_many :children, :class_name => "SectionTemplate", :foreign_key => "section_id_parent"
end

any idea of what I'm doing wrong?

regards