From 165a312fb3c3ad0e55478b99fa1851b5ee8c56a0 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 30 Jul 2010 13:26:11 -0700 Subject: changing default value to TrueClass --- lib/arel/algebra/relations/operations/lock.rb | 8 +------- lib/arel/algebra/relations/relation.rb | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/arel') 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 -- cgit v1.2.3