lib/queries/serial/autocomplete.rb
# TODO: these three should be factored out to just the join, made more Arel like
#
these three should be factored out to just the join, made more Arel like
these three should be factored out to just the join made more Arel like
def autocomplete_ordered_wildcard_alternate_value(attribute = 'name', type = 'AlternateValue')
        ::Serial.joins(:alternate_values).where(
          alternate_value_table[:type].eq(type).and(
          alternate_value_table[:alternate_value_object_attribute].eq(attribute).
          and(alternate_value_table[:value].matches(wildcard_pieces))).to_sql
        ).limit(5)
      end
def autocomplete_ordered_wildcard_alternate_value ( attribute = 'name' , type = 'AlternateValue' ) :: Serial . joins ( :alternate_values ) . where ( alternate_value_table [ :type ] . eq ( type ) . and ( alternate_value_table [ :alternate_value_object_attribute ] . eq ( attribute ) . and ( alternate_value_table [ :value ] . matches ( wildcard_pieces ) ) ) . to_sql ) . limit ( 5 ) end
TODO: these three should be factored out to just the join, made more Arel like
TODO : these three should be factored out to just the join made more Arel like
attribute
<not_specific>
type
<not_specific>