Permalink
Browse files

s/url/path

  • Loading branch information...
1 parent d99fa19 commit 110e36010951ece994a09babf18c602a300f188c @nelstrom committed Mar 8, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 app/models/event_archive_page.rb
@@ -1,16 +1,16 @@
class EventArchivePage < ArchivePage
- def child_url(child)
+ def child_path(child)
date = child.event_datetime_start || Time.now
if child.virtual?
- clean_url "#{ url }/#{ child.slug }"
+ clean_path "#{ path }/#{ child.slug }"
else
- clean_url "#{ url }/#{ date.strftime '%Y/%m/%d' }/#{ child.slug }"
+ clean_path "#{ path }/#{ date.strftime '%Y/%m/%d' }/#{ child.slug }"
end
end
- def find_by_url(url, live = true, clean = false)
- url = clean_url(url) if clean
- if url =~ %r{^#{ self.url }(\d{4})(?:/(\d{2})(?:/(\d{2}))?)?/?$}
+ def find_by_path(path, live = true, clean = false)
+ path = clean_path(path) if clean
+ if path =~ %r{^#{ self.path }(\d{4})(?:/(\d{2})(?:/(\d{2}))?)?/?$}
year, month, day = $1, $2, $3
children.find_by_class_name(
case
@@ -22,7 +22,7 @@ def find_by_url(url, live = true, clean = false)
'EventYearIndexPage'
end
)
- elsif url =~ %r{^#{ self.url }(fall|spring)/?$}
+ elsif path =~ %r{^#{ self.path }(fall|spring)/?$}
children.find_by_class_name('EventSeasonIndexPage')
else
super

0 comments on commit 110e360

Please sign in to comment.