Open VladislavShved opened 7 years ago
NoMethodError at /world~science~research undefined method 'properties' for nil:NilClass
block in <class:BelongsToAssociation> rails_admin (1.1.1) lib/rails_admin/config/fields/types/belongs_to_association.rb, line 19
at
@searchable ||= associated_model_config.abstract_model.properties.collect(&:name).include?(associated_model_config.object_label_method) ? [associated_model_config.object_label_method, {abstract_model.model => method_name}] : {abstract_model.model => method_name}
associated_model_config.abstract_model returns Nil
associated_model_config.abstract_model
For example:
class Item < ActiveRecord::Base belongs_to :shop end class Shop < ActiveRecord::Base self.abstract_class = true has_many :items end
Fixed at my fork https://github.com/VladislavShved/rails_admin
NoMethodError at /world~science~research undefined method 'properties' for nil:NilClass
block in <class:BelongsToAssociation> rails_admin (1.1.1) lib/rails_admin/config/fields/types/belongs_to_association.rb, line 19
at
@searchable ||= associated_model_config.abstract_model.properties.collect(&:name).include?(associated_model_config.object_label_method) ? [associated_model_config.object_label_method, {abstract_model.model => method_name}] : {abstract_model.model => method_name}
associated_model_config.abstract_model
returns NilFor example: