gluttonberg/app/models/page_localization.rb
# Forces the localization to regenerate it's full path. It will firstly
# look to see if there is a parent page that it need to derive the path
# prefix from. Otherwise it will just use the slug, with a fall-back
# to it's page's default.
Forces the localization to regenerate it's full path. It will firstly
look to see if there is a parent page that it need to derive the path
prefix from. Otherwise it will just use the slug, with a fall-back
to it's page's default.
Forces the localization to regenerate it ' s full path . It will firstly look to see if there is a parent page that it need to derive the path prefix from . Otherwise it will just use the slug with a fall - back to it ' s page ' s default .
def regenerate_path
      if page.parent_id
        localization = page.parent.localizations.first(
          :fields           => [:path],
          :locale_id        => locale_id, 
          :dialect_id       => dialect_id
        )
        path = "#{localization.path}/#{slug || page.slug}"
      else
        path = "#{slug || page.slug}"
      end
      attribute_set(:path, path)
    end
def regenerate_path if page . parent_id localization = page . parent . localizations . first ( :fields => [ :path ] , :locale_id => locale_id , :dialect_id => dialect_id ) path = "#{localization.path}/#{slug || page.slug}" else path = "#{slug || page.slug}" end attribute_set ( :path , path ) end
Forces the localization to regenerate it's full path.
Forces the localization to regenerate it ' s full path .