diff options
Diffstat (limited to 'activeresource/lib/active_resource/base.rb')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index b976844c1c..6397fbc280 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -582,12 +582,13 @@ module ActiveResource # Clear prefix parameters in case they have been cached @prefix_parameters = nil - # Redefine the new methods. - code, line = <<-end_code, __LINE__ + 1 - def prefix_source() "#{value}" end - def prefix(options={}) "#{prefix_call}" end - end_code - silence_warnings { instance_eval code, __FILE__, line } + silence_warnings do + # Redefine the new methods. + instance_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 + def prefix_source() "#{value}" end + def prefix(options={}) "#{prefix_call}" end + RUBY_EVAL + end rescue logger.error "Couldn't set prefix: #{$!}\n #{code}" if logger raise |