Class: BabySqueel::JoinDependency::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/baby_squeel/join_dependency/finder.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(join_dependency) ⇒ Finder

Returns a new instance of Finder.



6
7
8
# File 'lib/baby_squeel/join_dependency/finder.rb', line 6

def initialize(join_dependency)
  @join_dependency = join_dependency
end

Instance Attribute Details

#join_dependencyObject (readonly)

Returns the value of attribute join_dependency.



4
5
6
# File 'lib/baby_squeel/join_dependency/finder.rb', line 4

def join_dependency
  @join_dependency
end

Instance Method Details

#find_alias(reflection) ⇒ Object



10
11
12
13
# File 'lib/baby_squeel/join_dependency/finder.rb', line 10

def find_alias(reflection)
  join_association = find_association(reflection)
  join_association.tables.first if join_association
end