aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-30 13:26:11 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-30 13:26:11 -0700
commit165a312fb3c3ad0e55478b99fa1851b5ee8c56a0 (patch)
tree8578c5d7d6bb9b11383b1dee87c086c500b0ddb8
parentfa0f32d3cd0bc9fbc17ddfa5bbb699064c443c5c (diff)
downloadrails-165a312fb3c3ad0e55478b99fa1851b5ee8c56a0.tar.gz
rails-165a312fb3c3ad0e55478b99fa1851b5ee8c56a0.tar.bz2
rails-165a312fb3c3ad0e55478b99fa1851b5ee8c56a0.zip
changing default value to TrueClass
-rw-r--r--lib/arel/algebra/relations/operations/lock.rb8
-rw-r--r--lib/arel/algebra/relations/relation.rb2
2 files changed, 2 insertions, 8 deletions
diff --git a/lib/arel/algebra/relations/operations/lock.rb b/lib/arel/algebra/relations/operations/lock.rb
index 003bd29c8a..394ad6f0ec 100644
--- a/lib/arel/algebra/relations/operations/lock.rb
+++ b/lib/arel/algebra/relations/operations/lock.rb
@@ -4,13 +4,7 @@ module Arel
def initialize(relation, locked)
super(relation)
- @locked = locked.blank? ? " FOR UPDATE" : locked
- end
-
- def == other
- super || Lock === other &&
- relation == other.relation &&
- locked == other.locked
+ @locked = true == locked ? " FOR UPDATE" : locked
end
end
end
diff --git a/lib/arel/algebra/relations/relation.rb b/lib/arel/algebra/relations/relation.rb
index 804ef5a09f..c6e2727c8f 100644
--- a/lib/arel/algebra/relations/relation.rb
+++ b/lib/arel/algebra/relations/relation.rb
@@ -144,7 +144,7 @@ module Arel
From.new self, thing
end
- def lock(locking = nil)
+ def lock(locking = true)
Lock.new(self, locking)
end