aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/algebra/relations')
-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