1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
module Arel class Lock < Compound attr_reader :locked def initialize(relation, locked) super(relation) @locked = locked.blank? ? " FOR UPDATE" : locked end def == other super || Lock === other && relation == other.relation && locked == other.locked end end end