Skip to content

Commit

Permalink
Workaround situation where Site being lazily loaded meant that 'defin…
Browse files Browse the repository at this point in the history
…ed? Site' would return nil, even when Site was accessible (possibly only in development) - http://gist.github.com/466128 .
  • Loading branch information
gunn committed Jul 7, 2010
1 parent 3d54d75 commit 22ce944
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions share_layouts_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class ShareLayoutsExtension < Radiant::Extension
map.connect ':controller/:action/:id'
end
end

def activate
require 'share_layouts/radiant_layouts'
require 'share_layouts/radiant_mailer_layouts'

RailsPage
ActionView::Base.send :include, ShareLayouts::Helper
ApplicationController.send :include, ShareLayouts::ControllerExtensions
Site.send :include, ShareLayouts::SiteExtensions if defined? Site
Site.send :include, ShareLayouts::SiteExtensions if Site rescue nil
end

def deactivate
Expand Down

0 comments on commit 22ce944

Please sign in to comment.