Class: Effective::Ring
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::Ring
- Defined in:
- app/models/effective/ring.rb
Constant Summary collapse
- SIZES =
[3, 4, 5, 6, 7, 8]
- TITANIUM_SIZES =
[3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
- METALS =
['14k Yellow Gold', 'Sterling Silver', 'Titanium']
Instance Method Summary collapse
- #issued? ⇒ Boolean
- #mark_as_issued! ⇒ Object
-
#mark_paid! ⇒ Object
This is the Admin Save and Mark Paid action.
- #to_s ⇒ Object
Instance Method Details
#issued? ⇒ Boolean
62 63 64 |
# File 'app/models/effective/ring.rb', line 62 def issued? issued_at.present? end |
#mark_as_issued! ⇒ Object
58 59 60 |
# File 'app/models/effective/ring.rb', line 58 def mark_as_issued! update!(issued_at: Time.zone.now) end |
#mark_paid! ⇒ Object
This is the Admin Save and Mark Paid action
67 68 69 70 71 72 73 74 75 76 |
# File 'app/models/effective/ring.rb', line 67 def mark_paid! raise('expected a blank ring payment') if ring_payment.present? save! order = Effective::Order.new(items: self, user: owner) order.purchase!(skip_buyer_validations: true, email: false) true end |
#to_s ⇒ Object
54 55 56 |
# File 'app/models/effective/ring.rb', line 54 def to_s ["Chemist's Ring", (" - #{} size #{size}" if .present? && size.present?)].compact.join end |