Class: TaxCategory

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

Instance Method Summary collapse

Instance Method Details

#set_default_categoryObject



8
9
10
11
12
13
14
# File 'app/models/tax_category.rb', line 8

def set_default_category
  #set existing default tax category to false if this one has been marked as default

  if is_default && tax_category = TaxCategory.find(:first, :conditions => {:is_default => true})
    tax_category.update_attribute(:is_default, false)
  end
end