aboutsummaryrefslogblamecommitdiffstats
path: root/lib/arel/algebra/relations/operations/lock.rb
blob: 003bd29c8ad3290a95e248ec408fb025cf994edd (plain) (tree)
1
2
3
4
5
6
7
8

                       
                       
 
                                    
                     

                                                        





                                            

     
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