Class: ActiveRecord::Relation::FromClause

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/relation/from_clause.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, name) ⇒ FromClause

Returns a new instance of FromClause.


6
7
8
9
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 6

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


4
5
6
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 4

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value


4
5
6
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 4

def value
  @value
end

Class Method Details

.emptyObject


27
28
29
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 27

def self.empty
  @empty ||= new(nil, nil)
end

Instance Method Details

#bindsObject


11
12
13
14
15
16
17
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 11

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

#empty?Boolean

Returns:

  • (Boolean)

23
24
25
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 23

def empty?
  value.nil?
end

#merge(other) ⇒ Object


19
20
21
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 19

def merge(other)
  self
end