Sha256: c5d9493ff753f5d1008c19346b973a881bf14ecd2199f26015b4e0da76ed711f

Contents?: true

Size: 577 Bytes

Versions: 2

Compression:

Stored size: 577 Bytes

Contents

# get Notifications
Spree::BaseHelper.class_eval do
  def get_notification
    notifications = []
    session['show_notification'] = true if session['show_notification'].nil?
    if session['show_notification']
      session['show_notification'] = true
      current_time = Time.now.getutc
      notifications =
        Spree::Notification.where('start_date <= :start_date_cond AND
                                  end_date >= :end_date_cond',
                                  {start_date_cond: current_time, end_date_cond: current_time})
    end
    notifications
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_custom_notifications-0.4 app/helpers/base_helper_decorator.rb
spree_custom_notifications-0.3 app/helpers/base_helper_decorator.rb