Class: ActiveRecordQuery::Joinable::JoinedResource

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record_query/concerns/joinable.rb

Overview

The object holds the columns called from a joined resource.

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ JoinedResource

Returns a new instance of JoinedResource.



8
9
10
# File 'lib/active_record_query/concerns/joinable.rb', line 8

def initialize(resource)
  @resource = resource
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *_args, &block) ⇒ Object



12
13
14
# File 'lib/active_record_query/concerns/joinable.rb', line 12

def method_missing(method_name, *_args, &block)
  Column.new(Arel::Table.new(resource), method_name)
end