lib/seiten/page_store.rb in seiten-0.0.1 vs lib/seiten/page_store.rb in seiten-0.0.2
- old
+ new
@@ -5,11 +5,10 @@
attr_accessor :storage_type, :storage_file, :storage_directory
def initialize(options={})
@storage_type = options[:storage_type]
@storage_file = options[:storage_file]
- @storage_directory = options[:storage_directory]
@storage_type ||= Seiten.config[:storage_type]
@storage_file ||= File.join(Rails.root, Seiten.config[:storage_file])
end
@@ -35,10 +34,10 @@
page["parent_id"] = parent_id
@id += 1
# Build link
slug = page["url"].nil? ? page["title"].parameterize : page["url"]
- if slug[0] == "/" || !!(slug.match(/^http:\/\/.+/))
+ if slug[0] == "/" || !!(slug.match(/^https?:\/\/.+/))
page["slug"] = slug
else
page["slug"] = "#{url}/#{slug}"
end