Class: Highrise::Deal::DealCategory

Inherits:
Base
  • Object
show all
Defined in:
lib/highrise/deal.rb

Class Method Summary collapse

Class Method Details

.delete!(name) ⇒ Object



28
29
30
31
# File 'lib/highrise/deal.rb', line 28

def self.delete!(name)
  category = self.find_by_name(name)
  delete(category.id) if category
end

.find_by_name(name) ⇒ Object



24
25
26
# File 'lib/highrise/deal.rb', line 24

def self.find_by_name(name)
  find(:all).select{|category| category.name == name}.first
end