Class: ViewQuoteSuffix

Inherits:
ApplicationViewRecord show all
Defined in:
app/models/view_quote_suffix.rb

Overview

== Schema Information

Table name: view_quote_suffixes
Database name: primary

suffix :string(255)

Class Method Summary collapse

Methods inherited from ApplicationViewRecord

create, create!, #readonly?

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.lookupActiveRecord::Relation<ViewQuoteSuffix>

A relation of ViewQuoteSuffixes that are lookup. Active Record Scope

Returns:

See Also:



9
# File 'app/models/view_quote_suffix.rb', line 9

scope :lookup, ->(q) { where("view_quote_suffixes.suffix ILIKE :term", term: "%#{q}%").order([Arel.sql('view_quote_suffixes.suffix <-> ?'), q]) }