Class: Spree::TaxCategory

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

Instance Method Summary collapse

Instance Method Details

#mark_deleted!Object



19
20
21
22
# File 'app/models/spree/tax_category.rb', line 19

def mark_deleted!
  self.deleted_at = Time.now
  self.save
end

#set_default_categoryObject



11
12
13
14
15
16
17
# File 'app/models/spree/tax_category.rb', line 11

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

  if is_default && tax_category = self.class.where(:is_default => true).first
    tax_category.update_attribute(:is_default, false)
  end
end