bunch of minor fixes
This commit is contained in:
@@ -2,4 +2,18 @@ class Category < ActiveRecord::Base
|
||||
has_many :sub_categories
|
||||
has_many :filter_criterias, as: :owner
|
||||
belongs_to :section
|
||||
|
||||
rails_admin do
|
||||
object_label_method do
|
||||
:custom_cat_name
|
||||
end
|
||||
end
|
||||
|
||||
def custom_cat_name
|
||||
return self.name if not self.section
|
||||
|
||||
section = self.section.name
|
||||
"#{section} -> #{self.name}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user