spree_custom_notifications 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5c2744e5a2ae4e94afda271b68420e779c47959
4
- data.tar.gz: b8149e69aa80ec0f20fae1a79898a3e815032bc5
3
+ metadata.gz: 60528e55a869b1f69a5899e49f5e6911559f0df8
4
+ data.tar.gz: bcc779f836e6fda6f8520e317a502777cb2f0477
5
5
  SHA512:
6
- metadata.gz: 59840ea66649b1925f97c34267e683f8e1a0c8e9410813b902a6c1700d11457aa9aa141976c46baac1adbbdcf6aec4a4637422e4cbe9b342e1bc4d00747599c2
7
- data.tar.gz: bc477ecc192061bd6e2c360bb462ba7fb113c7787d678c165264ea71beae11bdad4a5b7ba477b48110bd802c7cc4802b5d789a477aac43fa74afb549b7d807f5
6
+ metadata.gz: 1db27b953f4dd4c48ee07c72b1efcf4a6b6838cdb07aecb59e01311ce22f09ca0cceff16cba749a5ab1ecf73a5aa1e32cde395bceab06852a905b3f9b9b7c7f1
7
+ data.tar.gz: 2ea7e8a4c51ce5ff09330a74cf0f52aa9401ed36ebdda95ff8de6b09bf7338e0e547a4be25be6eb4a81a8f2d855c67e7e66747930e463199f6cf4b500e437572
@@ -2,7 +2,7 @@ module Spree
2
2
  # Class NotificationController
3
3
  class NotificationsController < StoreController
4
4
  def destroy_notification
5
- session['show_notification'] = false
5
+ session['notification_hide_time'] = Time.now
6
6
  result = { success: true }
7
7
  render json: result
8
8
  end
@@ -2,14 +2,10 @@
2
2
  Spree::BaseHelper.class_eval do
3
3
  def get_notification
4
4
  notifications = []
5
- session['show_notification'] = true if session['show_notification'].nil?
6
- if session['show_notification']
7
- session['show_notification'] = true
8
- current_time = Time.now.getutc
9
- notifications =
10
- Spree::Notification.where('start_date <= :start_date_cond AND
11
- end_date >= :end_date_cond',
12
- {start_date_cond: current_time, end_date_cond: current_time})
5
+ if session['notification_hide_time'].nil?
6
+ notifications = Spree::Notification.where("start_date <= now() AND end_date >= now()")
7
+ else
8
+ notifications = Spree::Notification.where("start_date <= now() AND end_date >= now() AND updated_at > ?",session['notification_hide_time'])
13
9
  end
14
10
  notifications
15
11
  end
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_custom_notifications'
5
- s.version = '0.4'
5
+ s.version = '0.5'
6
6
  s.summary = 'Spree Store Custom Notifications'
7
7
  s.description = 'Display Custom notifications on Spree Store'
8
8
  s.required_ruby_version = '>= 1.9.3'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_custom_notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - prachidhabu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core