aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2009-09-20 12:59:32 -0400
committerBryan Helmkamp <bryan@brynary.com>2009-09-20 12:59:32 -0400
commit927d8b8cde930244a16215c57896c8e45f616d0f (patch)
tree0edfba7f236dddb2a3585a591588c21651dbb8b7 /lib
parent6690e3c007f65a39797a92462aaabf564bc709b4 (diff)
downloadrails-927d8b8cde930244a16215c57896c8e45f616d0f.tar.gz
rails-927d8b8cde930244a16215c57896c8e45f616d0f.tar.bz2
rails-927d8b8cde930244a16215c57896c8e45f616d0f.zip
Fix almost all Ruby warnings during spec suite
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/algebra/extensions/class.rb2
-rw-r--r--lib/arel/session.rb12
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/arel/algebra/extensions/class.rb b/lib/arel/algebra/extensions/class.rb
index 56cad3aaa8..d0894931da 100644
--- a/lib/arel/algebra/extensions/class.rb
+++ b/lib/arel/algebra/extensions/class.rb
@@ -2,7 +2,7 @@ module Arel
module ClassExtensions
def attributes(*attrs)
@attributes = attrs
- attr_reader *attrs
+ attr_reader(*attrs)
end
def deriving(*methods)
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