ClosureTree/closure_tree

Preferred method of storing path string in db?

beamercola opened this issue · 0 comments

I include path in the json, so I'm storing it as a string in the db. Is there a preferred method for doing this? Right now I'm doing:

  after_commit :cache_path, on: [:create]

  def cache_path
    self.path = ancestry_path.join("/")
    self.save
  end

thanks