Class: Workarea::Pricing::Price
- Inherits:
-
Object
- Object
- Workarea::Pricing::Price
- Includes:
- ApplicationDocument, Releasable
- Defined in:
- app/models/workarea/pricing/price.rb
Instance Method Summary collapse
- #generic? ⇒ Boolean
- #name ⇒ Object
-
#on_sale? ⇒ Boolean
Whether this price is on sale.
- #sell ⇒ Object
Methods included from Releasable
#activates_with_current_release?, #releasable?, #release_changes, #save_changeset, #skip_changeset
Methods included from ApplicationDocument
Methods included from Sidekiq::Callbacks
assert_valid_config!, async, disable, enable, inline, #run_callbacks
Instance Method Details
#generic? ⇒ Boolean
30 31 32 |
# File 'app/models/workarea/pricing/price.rb', line 30 def generic? min_quantity == 1 end |
#name ⇒ Object
18 19 20 |
# File 'app/models/workarea/pricing/price.rb', line 18 def name '' end |
#on_sale? ⇒ Boolean
Whether this price is on sale. Defaults to the #on_sale value of the Pricing::Sku it’s embedded within.
39 40 41 |
# File 'app/models/workarea/pricing/price.rb', line 39 def on_sale? super || sku&.on_sale? end |
#sell ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/models/workarea/pricing/price.rb', line 22 def sell if on_sale? && sale.present? sale else regular end end |