Class: FlexibleFilter::Reflection::BelongsTo

Inherits:
Object
  • Object
show all
Defined in:
lib/flexible_filter/reflection/belongs_to.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reflection) ⇒ BelongsTo



4
5
6
# File 'lib/flexible_filter/reflection/belongs_to.rb', line 4

def initialize(reflection)
  @reflection = reflection
end

Instance Attribute Details

#reflectionObject (readonly)

Returns the value of attribute reflection.



2
3
4
# File 'lib/flexible_filter/reflection/belongs_to.rb', line 2

def reflection
  @reflection
end

Instance Method Details

#foreign_tableObject



14
15
16
# File 'lib/flexible_filter/reflection/belongs_to.rb', line 14

def foreign_table
  reflection.active_record.arel_table
end

#primary_tableObject



10
11
12
# File 'lib/flexible_filter/reflection/belongs_to.rb', line 10

def primary_table
  reflection.klass.arel_table
end