diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2009-09-20 12:59:32 -0400 |
---|---|---|
committer | Bryan Helmkamp <bryan@brynary.com> | 2009-09-20 12:59:32 -0400 |
commit | 927d8b8cde930244a16215c57896c8e45f616d0f (patch) | |
tree | 0edfba7f236dddb2a3585a591588c21651dbb8b7 /lib/arel/session.rb | |
parent | 6690e3c007f65a39797a92462aaabf564bc709b4 (diff) | |
download | rails-927d8b8cde930244a16215c57896c8e45f616d0f.tar.gz rails-927d8b8cde930244a16215c57896c8e45f616d0f.tar.bz2 rails-927d8b8cde930244a16215c57896c8e45f616d0f.zip |
Fix almost all Ruby warnings during spec suite
Diffstat (limited to 'lib/arel/session.rb')
-rw-r--r-- | lib/arel/session.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/arel/session.rb b/lib/arel/session.rb index cf04e8a93a..d844cd7423 100644 --- a/lib/arel/session.rb +++ b/lib/arel/session.rb @@ -5,16 +5,22 @@ module Arel alias_method :manufacture, :new def start - if @started + if defined?(@started) && @started yield else begin @started = true @instance = manufacture - metaclass.send :alias_method, :new, :instance + metaclass.class_eval do + undef :new + alias_method :new, :instance + end yield ensure - metaclass.send :alias_method, :new, :manufacture + metaclass.class_eval do + undef :new + alias_method :new, :manufacture + end @started = false end end |