Module: Models::SearchableViewWithLineItems

Extended by:
ActiveSupport::Concern
Included in:
ViewInvoice, ViewOrder, ViewQuote
Defined in:
app/concerns/models/searchable_view_with_line_items.rb

Overview

ActiveSupport::Concern mixin: searchable view with line items.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.contains_item_idsActiveRecord::Relation<Models::SearchableViewWithLineItems>

A relation of Models::SearchableViewWithLineItems that are contains item ids. Active Record Scope

Returns:

See Also:



64
65
66
# File 'app/concerns/models/searchable_view_with_line_items.rb', line 64

scope :contains_item_ids, ->(*item_ids) {
  where(item_sql_check, clean_array_params(item_ids))
}

.contains_product_category_idsActiveRecord::Relation<Models::SearchableViewWithLineItems>

A relation of Models::SearchableViewWithLineItems that are contains product category ids. Active Record Scope

Returns:

See Also:



84
85
86
87
# File 'app/concerns/models/searchable_view_with_line_items.rb', line 84

scope :contains_product_category_ids, ->(*product_category_ids) {
  ids = clean_array_params(product_category_ids)
  where(product_category_sql_check, ids)
}

.contains_product_line_idsActiveRecord::Relation<Models::SearchableViewWithLineItems>

A relation of Models::SearchableViewWithLineItems that are contains product line ids. Active Record Scope

Returns:

See Also:



73
74
75
76
# File 'app/concerns/models/searchable_view_with_line_items.rb', line 73

scope :contains_product_line_ids, ->(*product_line_ids) {
  ids = clean_array_params(product_line_ids)
  where(product_line_sql_check, ids, ids)
}

.not_contains_item_idsActiveRecord::Relation<Models::SearchableViewWithLineItems>

A relation of Models::SearchableViewWithLineItems that are not contains item ids. Active Record Scope

Returns:

See Also:



68
69
70
# File 'app/concerns/models/searchable_view_with_line_items.rb', line 68

scope :not_contains_item_ids, ->(*item_ids) {
  where.not(item_sql_check, clean_array_params(item_ids))
}

.not_contains_product_category_idsActiveRecord::Relation<Models::SearchableViewWithLineItems>

A relation of Models::SearchableViewWithLineItems that are not contains product category ids. Active Record Scope

Returns:

See Also:



89
90
91
92
# File 'app/concerns/models/searchable_view_with_line_items.rb', line 89

scope :not_contains_product_category_ids, ->(*product_category_ids) {
  ids = clean_array_params(product_category_ids)
  where.not(product_category_sql_check, ids)
}

.not_contains_product_line_idsActiveRecord::Relation<Models::SearchableViewWithLineItems>

A relation of Models::SearchableViewWithLineItems that are not contains product line ids. Active Record Scope

Returns:

See Also:



78
79
80
81
# File 'app/concerns/models/searchable_view_with_line_items.rb', line 78

scope :not_contains_product_line_ids, ->(*product_line_ids) {
  ids = clean_array_params(product_line_ids)
  where.not(product_line_sql_check, ids, ids)
}