lib/mongoid/path_extension.rb in mongoid-path_extension-0.2.0 vs lib/mongoid/path_extension.rb in mongoid-path_extension-0.2.1
- old
+ new
@@ -22,10 +22,10 @@
components.last
end
def permalink=(value)
return if value.blank?
- new_str = [parent.to_s, value].join('/')
+ new_str = [parent&.to_s, value].compact.join("/")
@str.replace(new_str)
end
def absolute
['/', @str].join