app/models/page_context.rb in radiant-0.6.4 vs app/models/page_context.rb in radiant-0.6.5
- old
+ new
@@ -2,14 +2,12 @@
attr_reader :page
def initialize(page)
super()
-
@page = page
globals.page = @page
-
page.tags.each do |name|
define_tag(name) { |tag_binding| page.render_tag(name, tag_binding) }
end
end
@@ -17,11 +15,11 @@
binding = @tag_binding_stack.last
locals = binding ? binding.locals : globals
set_process_variables(locals.page)
super
rescue Exception => e
- raise e if testing?
+ raise e if raise_errors?
@tag_binding_stack.pop unless @tag_binding_stack.last == binding
render_error_message(e.message)
end
def tag_missing(name, attributes = {}, &block)
@@ -39,10 +37,10 @@
def set_process_variables(page)
page.request ||= @page.request
page.response ||= @page.response
end
- def testing?
- RAILS_ENV == 'test'
+ def raise_errors?
+ RAILS_ENV != 'production'
end
end