Class: AlchemyCrm::ContactGroupFilter

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/alchemy_crm/contact_group_filter.rb

Constant Summary collapse

OPERATORS =
[
  [::I18n.t(:like, :scope => 'alchemy_crm.contact_group_filter_operators', :default => 'Contains'), "LIKE"],
  [::I18n.t(:not_like, :scope => 'alchemy_crm.contact_group_filter_operators', :default => 'Contains not'), "NOT LIKE"],
  [::I18n.t(:equals, :scope => 'alchemy_crm.contact_group_filter_operators', :default => 'Equals'), "="],
  [::I18n.t(:equals_not, :scope => 'alchemy_crm.contact_group_filter_operators', :default => 'Equals not'), "!="]
]

Instance Method Summary collapse

Instance Method Details

#sql_stringObject



14
15
16
17
# File 'app/models/alchemy_crm/contact_group_filter.rb', line 14

def sql_string
  return "" if column.blank? || operator.blank? || prepared_value.blank?
  "`#{Contact.table_name}`.`#{column}` #{operator} '#{prepared_value}'"
end