notification-handler 1.0.0.beta10 → 1.0.0.beta11

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
  SHA256:
3
- metadata.gz: b2b18f64cb68e1f58ac24be60b5eea1d2ef5b396d5cba9f9610e55b82d22a8bd
4
- data.tar.gz: d55e4adbe2d2749fcd4d11dd17ac568e4bed0bb46bec49002ae412c3342c7083
3
+ metadata.gz: e19e115e549d5f4719e0d3cccabb810d81f0ee26cc819a4aaca95fba05c51dc6
4
+ data.tar.gz: a9c2163c46eac8da67283de29903d9f697270570bc34872bac5596893310826d
5
5
  SHA512:
6
- metadata.gz: ed07cd30a35be5d3afe454e493d5625a3bb3e0461e8bc42af6e2f2b6182b2773f00f47bdad21d19a9ef4d9b68b36a1d62cee73d86020101338cdda16788e62a1
7
- data.tar.gz: a5725970157c3642a2bd9b40f4693443e37a7249881240fa83058aafda2c2628352fc1a38b3e46d4ac501b89f8c6a3ab0b4015acc0e66ef1b49e54e50011f097
6
+ metadata.gz: a1f9abe475b408800b7da6bee0268b11266048b6db5ae4582f6cef001a255abe0daa62500a32ad8957a5a87f80fdccb55f40fc3386c61826bf9bbad53e5f9107
7
+ data.tar.gz: 257a40edbf8e496b28946f26b04118cd23ebcb00370a9c565174beafe746f9187b9329eec1be8a3437282b59cb66b03bc9db4db1849f2f47cd5c03fc998b7dc3
@@ -0,0 +1,6 @@
1
+ class NotificationHandler::Notification < ApplicationRecord
2
+
3
+ include NotificationHandler::NotificationLibrary
4
+ include NotificationHandler::NotificationScopes
5
+
6
+ end
@@ -1,6 +1,2 @@
1
- class Notification < ApplicationRecord
2
-
3
- include NotificationHandler::NotificationLibrary
4
- include NotificationHandler::NotificationScopes
5
-
1
+ class Notification < NotificationHandler::Notification
6
2
  end
@@ -2,6 +2,8 @@ module NotificationHandler
2
2
 
3
3
  require 'notification_handler/configuration'
4
4
 
5
+ require 'notification_handler/engine'
6
+
5
7
  autoload :Group, 'notification_handler/group'
6
8
 
7
9
  autoload :Target, 'notification_handler/target'
@@ -11,14 +11,16 @@ module NotificationHandler
11
11
 
12
12
  class Configuration
13
13
 
14
+ attr_accessor :groups
14
15
  attr_accessor :cache
15
16
 
16
17
  def initialize
18
+ @groups = []
17
19
  @cache = false
18
20
  end
19
21
 
20
22
  def define_group name, target_scope
21
- ::NotificationHandler::Group.new name.to_sym, target_scope
23
+ self.groups << ::NotificationHandler::Group.new(name.to_sym, target_scope)
22
24
  end
23
25
 
24
26
  end
@@ -0,0 +1,7 @@
1
+ require 'rails/railtie'
2
+ require 'active_record'
3
+
4
+ module NotificationHandler
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
@@ -10,7 +10,7 @@ module NotificationHandler
10
10
  end
11
11
 
12
12
  def self.find_by_name name
13
- ObjectSpace.each_object(NotificationHandler::Group).select { |group| group.name == name.to_sym }
13
+ NotificationHandler.configuration.groups.select { |group| group.name == name.to_sym }
14
14
  end
15
15
 
16
16
  end
@@ -1,3 +1,5 @@
1
+ require 'active_support'
2
+
1
3
  module NotificationHandler
2
4
  module NotificationLibrary
3
5
 
@@ -1,3 +1,5 @@
1
+ require 'active_support'
2
+
1
3
  module NotificationHandler
2
4
  module NotificationScopes
3
5
 
@@ -9,9 +9,9 @@ module NotificationHandler
9
9
  def notification_object
10
10
  has_many :belonging_notifications, as: :object, class_name: 'Notification', dependent: :destroy
11
11
  include NotificationHandler::Object::InstanceMethods
12
-
13
- extend NotificationSettings::Object if defined?(NotificationSettings)
14
- extend NotificationSettings::Subscribable if defined?(NotificationSettings)
12
+
13
+ include NotificationSettings::Object if defined?(NotificationSettings)
14
+ include NotificationSettings::Subscribable if defined?(NotificationSettings)
15
15
  end
16
16
  end
17
17
 
@@ -1,5 +1,6 @@
1
1
  require 'rails/railtie'
2
2
  require 'active_record'
3
+ require 'active_support'
3
4
 
4
5
  module NotificationHandler
5
6
  class Railtie < Rails::Railtie
@@ -10,8 +10,8 @@ module NotificationHandler
10
10
  has_many :notifications, as: :target, dependent: :destroy
11
11
  include NotificationHandler::Target::InstanceMethods
12
12
 
13
- extend NotificationSettings::Target if defined?(NotificationSettings)
14
- extend NotificationSettings::Subscriber if defined?(NotificationSettings)
13
+ include NotificationSettings::Target if defined?(NotificationSettings)
14
+ include NotificationSettings::Subscriber if defined?(NotificationSettings)
15
15
  end
16
16
  end
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notification-handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta10
4
+ version: 1.0.0.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Hübotter
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +89,7 @@ files:
75
89
  - CHANGELOG.md
76
90
  - LICENSE
77
91
  - README.md
92
+ - app/models/notification_handler/notification.rb
78
93
  - lib/generators/notification_handler/install_generator.rb
79
94
  - lib/generators/templates/install/README.md
80
95
  - lib/generators/templates/install/initializer.rb
@@ -82,6 +97,7 @@ files:
82
97
  - lib/generators/templates/install/notifications_migration.rb.erb
83
98
  - lib/notification-handler.rb
84
99
  - lib/notification_handler/configuration.rb
100
+ - lib/notification_handler/engine.rb
85
101
  - lib/notification_handler/group.rb
86
102
  - lib/notification_handler/notification_library.rb
87
103
  - lib/notification_handler/notification_scopes.rb