aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/operations/lock.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/algebra/relations/operations/lock.rb')
-rw-r--r--lib/arel/algebra/relations/operations/lock.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/arel/algebra/relations/operations/lock.rb b/lib/arel/algebra/relations/operations/lock.rb
new file mode 100644
index 0000000000..0d6c12e65b
--- /dev/null
+++ b/lib/arel/algebra/relations/operations/lock.rb
@@ -0,0 +1,12 @@
+module Arel
+ class Lock < Compound
+ attributes :relation, :locked
+ deriving :initialize, :==
+
+ def initialize(relation, locked, &block)
+ @relation = relation
+ @locked = locked.blank? ? " FOR UPDATE" : locked
+ end
+ end
+end
+