Skip to content

Commit

Permalink
Instantiating a new page hits the DB before it's bootstrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh French committed Dec 15, 2010
1 parent b7e3124 commit 6838411
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/archive_page.rb
Expand Up @@ -2,7 +2,7 @@ class ArchivePage < Page
cattr_accessor :allowed_children
cattr_accessor :single_use_children
@@single_use_children = [ArchiveDayIndexPage, ArchiveMonthIndexPage, ArchiveYearIndexPage, FileNotFoundPage]
@@allowed_children = [self.new.default_child, *@@single_use_children]
@@allowed_children = [self.default_child, *@@single_use_children]

def allowed_children
overlap = @@allowed_children & (existing_child_types - [default_child])
Expand Down Expand Up @@ -49,4 +49,4 @@ def find_by_path(path, live = true, clean = false)
end
end
alias_method :find_by_url, :find_by_path
end
end

0 comments on commit 6838411

Please sign in to comment.