diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-05-19 16:37:41 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-20 15:18:57 +0200 |
commit | aacf2581cde0147dc66c3eeacf6d7447c2bbafdf (patch) | |
tree | a7f099044c0e8678454af5852a415c757c567c94 /actionpack/lib/abstract_controller | |
parent | 7f07cc364a7ee7ceae21b29b54467fde0db93389 (diff) | |
download | rails-aacf2581cde0147dc66c3eeacf6d7447c2bbafdf.tar.gz rails-aacf2581cde0147dc66c3eeacf6d7447c2bbafdf.tar.bz2 rails-aacf2581cde0147dc66c3eeacf6d7447c2bbafdf.zip |
refactor evals and adds some __FILE__ and __LINE__
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/layouts.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 319472c937..5cd7a90ab5 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -245,7 +245,7 @@ module AbstractController case defined?(@_layout) ? @_layout : nil when String - self.class_eval %{def _layout; #{@_layout.inspect} end} + self.class_eval %{def _layout; #{@_layout.inspect} end}, __FILE__, __LINE__ when Symbol self.class_eval <<-ruby_eval, __FILE__, __LINE__ + 1 def _layout @@ -259,9 +259,9 @@ module AbstractController ruby_eval when Proc define_method :_layout_from_proc, &@_layout - self.class_eval %{def _layout; _layout_from_proc(self) end} + self.class_eval %{def _layout; _layout_from_proc(self) end}, __FILE__, __LINE__ when false - self.class_eval %{def _layout; end} + self.class_eval %{def _layout; end}, __FILE__, __LINE__ when true raise ArgumentError, "Layouts must be specified as a String, Symbol, false, or nil" when nil |