Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

s/url/path

  • Loading branch information...
commit 110e36010951ece994a09babf18c602a300f188c 1 parent d99fa19
@nelstrom authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 app/models/event_archive_page.rb
View
14 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
Please sign in to comment.
Something went wrong with that request. Please try again.