Class: AlchemyCrm::ContactGroup

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

Instance Method Summary collapse

Instance Method Details

#contactsObject



13
14
15
# File 'app/models/alchemy_crm/contact_group.rb', line 13

def contacts
  Contact.tagged_with(self.contact_tags, :any => true).where(filters_sql_string)
end

#filters_sql_stringObject



17
18
19
# File 'app/models/alchemy_crm/contact_group.rb', line 17

def filters_sql_string
  filters.map(&:sql_string).join(' AND ')
end

#humanized_nameObject



21
22
23
# File 'app/models/alchemy_crm/contact_group.rb', line 21

def humanized_name
  "#{self.name} (#{self.contacts.length})"
end