Class: ProductOffer
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ProductOffer
- Defined in:
- app/models/product_offer.rb
Instance Method Summary collapse
Instance Method Details
#after_destroy ⇒ Object
24 25 26 27 28 |
# File 'app/models/product_offer.rb', line 24 def after_destroy if self.product_offer_record && !self.product_offer_record.frozen? self.product_offer_record.destroy end end |
#taxable? ⇒ Boolean
30 31 32 |
# File 'app/models/product_offer.rb', line 30 def taxable? self.product_offer_record.taxable? end |
#valid_from=(date) ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/models/product_offer.rb', line 8 def valid_from=(date) if date.is_a? String write_attribute(:valid_from, date.to_date) else super end end |
#valid_to=(date) ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/models/product_offer.rb', line 16 def valid_to=(date) if date.is_a? String write_attribute(:valid_to, date.to_date) else super end end |