Module: Stall::Models::Product
- Extended by:
- ActiveSupport::Concern
- Included in:
- Product
- Defined in:
- app/models/stall/models/product.rb
Instance Method Summary collapse
- #image(*args) ⇒ Object
-
#image? ⇒ Boolean
Support paperclip attachment presence helper for #image.
- #price ⇒ Object
- #vat_rate ⇒ Object
Instance Method Details
#image(*args) ⇒ Object
53 54 55 56 57 |
# File 'app/models/stall/models/product.rb', line 53 def image(*args) if (image = images.first) image.file end end |
#image? ⇒ Boolean
Support paperclip attachment presence helper for #image
60 61 62 |
# File 'app/models/stall/models/product.rb', line 60 def image? !!image end |
#price ⇒ Object
49 50 51 |
# File 'app/models/stall/models/product.rb', line 49 def price variants.map(&:price).min end |