Class: Generators::Joined

Inherits:
Base
  • Object
show all
Defined in:
lib/toschas/filterable/generators/joined.rb

Instance Attribute Summary

Attributes inherited from Base

#filters, #model, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Generators::Base

Instance Method Details

#generateObject



3
4
5
6
7
8
9
10
11
# File 'lib/toschas/filterable/generators/joined.rb', line 3

def generate
  filters.each do |filter|
    field = joined_field(filter)
    generate_joined_filter(filter, field, relation_name, options[:joins])
    if table_loaded? && range_filter?(field)
      generate_range_filter(filter, field, relation_name, options[:joins])
    end
  end
end