aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/operations/take.rb
blob: 299c29ab727f4666fbbb646563c42b1204b1cda8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Arel
  class Take < Compound
    attr_reader :taken

    def initialize relation, taken
      super(relation)
      @taken = taken
    end

    def externalizable?
      true
    end

    def eval
      unoperated_rows[0, taken]
    end
  end
end