aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/relation/from_clause.rb
blob: 92340216ed373a472ea4babbd090696f3a36c7c7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12

                   
                              








                                 
                                


















                      
module ActiveRecord
  class Relation
    class FromClause # :nodoc:
      attr_reader :value, :name

      def initialize(value, name)
        @value = value
        @name = name
      end

      def binds
        if value.is_a?(Relation)
          value.bound_attributes
        else
          []
        end
      end

      def merge(other)
        self
      end

      def empty?
        value.nil?
      end

      def self.empty
        new(nil, nil)
      end
    end
  end
end