lib/spontaneous/rack/back/preview.rb in spontaneous-0.2.0.beta9 vs lib/spontaneous/rack/back/preview.rb in spontaneous-0.2.0.beta10
- old
+ new
@@ -1,14 +1,14 @@
module Spontaneous::Rack::Back
class Preview < Base
include Spontaneous::Rack::Public
+ set :show_exceptions, proc { Spontaneous.development? || Spontaneous.test? }
+
# In preview mode we want to find pages even if they're
# invisible.
- def find_page_by_path(path)
- site.model.scope do
- site.by_path(path)
- end
+ def with_scope(&block)
+ site.model.scope(&block)
end
# Redirect to the edit UI if a preview page is being accessed directly
def ensure_edit_preview(path)
referer = env['HTTP_REFERER']