Module: Spree::Core::UserBanners
- Included in:
- User
- Defined in:
- lib/spree/core/user_banners.rb
Class Method Summary collapse
Instance Method Summary collapse
- #dismiss_banner(banner_id) ⇒ Object
- #dismissed_banner?(banner_id) ⇒ Boolean
- #dismissed_banner_ids ⇒ Object
Class Method Details
.included(base) ⇒ Object
7 8 9 |
# File 'lib/spree/core/user_banners.rb', line 7 def self.included(base) base.preference :dismissed_banners, :string, :default => '' end |
Instance Method Details
#dismiss_banner(banner_id) ⇒ Object
16 17 18 |
# File 'lib/spree/core/user_banners.rb', line 16 def () self. = .push(.to_sym).uniq.join(',') end |
#dismissed_banner?(banner_id) ⇒ Boolean
20 21 22 |
# File 'lib/spree/core/user_banners.rb', line 20 def () .include? .to_sym end |
#dismissed_banner_ids ⇒ Object
11 12 13 14 |
# File 'lib/spree/core/user_banners.rb', line 11 def dismissed = self. dismissed.split(',').map(&:to_sym) end |