Commit 8b684408 by ivan Lan

Fix catalog

parent 583e7f25
...@@ -24,7 +24,7 @@ module Shotengai ...@@ -24,7 +24,7 @@ module Shotengai
self.table_name = 'shotengai_catalogs' self.table_name = 'shotengai_catalogs'
validates_presence_of :name validates_presence_of :name
after_save :set_nested_level before_save :set_nested_level
class << self class << self
def inherited subclass def inherited subclass
...@@ -99,7 +99,7 @@ module Shotengai ...@@ -99,7 +99,7 @@ module Shotengai
private private
def set_nested_level def set_nested_level
self.update_column(:nested_level, self.ancestors.count) self.nested_level = self.ancestors.count
end end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment