1 2 3 4 5 6 7 8 9 10 11 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