notifly 0.3.5 → 0.3.6

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: 199c4354275abe7fdd5dfbc605a68a17205477ec
4
- data.tar.gz: 83ab9a0f55faaba7ff98f6fbf6e68919fbf8d963
3
+ metadata.gz: 2df7100faee398ad9ac50aaab87ad063ddcf7d0a
4
+ data.tar.gz: 72790782b041b4ac81bbad981267fede31588f56
5
5
  SHA512:
6
- metadata.gz: e78062c032b1bab6bb4ca30983d91ce80564051deac0ba68dc044aa9d49012f8aa828684bedeb154e450abc1b348e46b3ed6bcd0747ac9cbfa93873181e97b8e
7
- data.tar.gz: bbb624c480c39326c2fef39a1b5028223c08a7220ba4aec51241cd3bdea3b19b10cfdf84b40a7df5fe10d17eba3a8743a0bb6939ad81cfb8eef775544d451e30
6
+ metadata.gz: 2846b60d22749bfc7a23b60d07386d0b70a3e30c3ade0a941e5d6921cdf695545bcd9dcd47969c7bc8ecd8b87ad635b9cfb674c34fac8771a296c282ff55a200
7
+ data.tar.gz: 07eed94adc40047e73b626795e38d487c8ef71c5f24124ea57340081c7b70860c8e97b8994c8defd34c0693f0646e960c11daa1ef09ef3efb2ff66d35e148f56
@@ -42,7 +42,7 @@ module Notifly
42
42
  end
43
43
 
44
44
  def send_to_receiver
45
- Notifly::NotificationChannel.new(self.receiver_id).trigger(self)
45
+ Notifly::NotificationChannel.new(self.receiver_id).trigger(self) if self.kind == 'notification'
46
46
  end
47
47
  end
48
48
  end
@@ -1,3 +1,3 @@
1
1
  <div class="notifly-empty">
2
- <% t('notifly.view.no_notifications') %>
3
- </div>
2
+ <%= t('notifly.view.no_notifications') %>
3
+ </div>
@@ -1,18 +1,32 @@
1
- class ActionViewHelper
2
- attr_reader :action_view
3
- delegate *ActionView::Base.instance_methods, to: :action_view
1
+ module Notifly
2
+ class ActionViewHelper
3
+ attr_reader :action_view
4
+ delegate *ActionView::Base.instance_methods.reject { |m| [:object_id, :__send__].include? m }, to: :action_view
4
5
 
5
- def initialize
6
- notifly_path = File.expand_path(File.dirname(File.dirname(__FILE__))) + '../../app/views/notifly'
7
- ActionController::Base.prepend_view_path(notifly_path)
8
- @action_view = ActionView::Base.new(ActionController::Base.view_paths)
9
- @action_view.extend ApplicationHelper
6
+ def initialize
7
+ notifly_path = File.expand_path(File.dirname(File.dirname(__FILE__))) + '../../app/views/notifly'
8
+ rails_path = File.join(Rails.root, 'app/views/notifly')
10
9
 
11
- @action_view.class_eval do
12
- include Notifly::Engine.routes.url_helpers
10
+ ActionController::Base.prepend_view_path(notifly_path)
11
+ ActionController::Base.prepend_view_path(rails_path)
13
12
 
14
- def protect_against_forgery?
15
- false
13
+ @action_view = ActionView::Base.new(ActionController::Base.view_paths)
14
+ @action_view.extend ApplicationHelper
15
+
16
+ @action_view.class_eval do
17
+ include Notifly::Engine.routes.url_helpers
18
+ Dir[File.join(Rails.root, 'app/helpers/**/*.rb')].each do |f|
19
+ require f
20
+ include f.split('/').last.split('.').first.camelize.constantize
21
+ end
22
+
23
+ def protect_against_forgery?
24
+ false
25
+ end
26
+
27
+ def main_app
28
+ Rails.application.routes.url_helpers
29
+ end
16
30
  end
17
31
  end
18
32
  end
@@ -3,7 +3,7 @@ module Notifly
3
3
  def initialize(user_id)
4
4
  @user_id = user_id
5
5
  @channel = WebsocketRails.users[@user_id.to_s]
6
- @action_view = ActionViewHelper.new
6
+ @action_view = Notifly::ActionViewHelper.new
7
7
  end
8
8
 
9
9
  def trigger(notification)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Passalini
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-02 00:00:00.000000000 Z
12
+ date: 2015-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails