Class: Spree::Wishlist
- Inherits:
-
Object
- Object
- Spree::Wishlist
- Includes:
- SingleStoreResource
- Defined in:
- app/models/spree/wishlist.rb
Instance Method Summary collapse
- #include?(variant_id) ⇒ Boolean
-
#variant_ids ⇒ Array<Integer>
returns the variant ids in the wishlist.
-
#wished_items_count ⇒ Integer
returns the number of wished items in the wishlist.
Instance Method Details
#include?(variant_id) ⇒ Boolean
26 27 28 |
# File 'app/models/spree/wishlist.rb', line 26 def include?(variant_id) wished_items.exists?(variant_id: variant_id) end |
#variant_ids ⇒ Array<Integer>
returns the variant ids in the wishlist
40 41 42 |
# File 'app/models/spree/wishlist.rb', line 40 def variant_ids @variant_ids ||= wished_items.pluck(:variant_id) end |
#wished_items_count ⇒ Integer
returns the number of wished items in the wishlist
33 34 35 |
# File 'app/models/spree/wishlist.rb', line 33 def wished_items_count @wished_items_count ||= variant_ids.count end |