noticed 1.2.6 → 1.2.7

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: ac839e0194ed6ffcb49cdded96384b5e47aeed9dbd407e92b7e18d67d700efcb
4
- data.tar.gz: 4f8bea6c1e9b7b7c1d841a4110bce06a6db56aaa36db358d6ed129294268e6a8
3
+ metadata.gz: fcd5afdca1ab2862bca9259b3015f86d93ab323eb64b6f8de666f9067216b202
4
+ data.tar.gz: 8c6a53d533eb2667c44804b4a7a5e518b4ab7938b345c6105490145bb4fdb75a
5
5
  SHA512:
6
- metadata.gz: 5d5b49fa5aabd5e94ad370938f157e0ee55e28727b1f1da221924c2d5de40e629f29f909e9f77caa2908dad316777e6f7a66be1c6c290f5f013d3e9407781b28
7
- data.tar.gz: 5db5ca0a303953ea1b82d6bf2d1ab6948e4bcbde8b6cb56c73e1a286732239cdeeb7d77b677d40ed77fa6d801de1069c3882b2006616f99f288f97c2e0d1a958
6
+ metadata.gz: 21ea1e549dcbd0857fea6538a0fc2d17ba5f0d249b7f39d1e1d33a56cbece35a3413605d8c1a6e71a381a424b6db93c82bfe7de19d87e3e669c569926fa4a42b
7
+ data.tar.gz: 1e85eb2edfbbac61fa9bcacf91a4fe041adc945c54ad029a6e8ab75e3d4fc64d52fbcf8527e43da9d0fd3c30e267c2c1e13bafbdf10662f6f826758a1a4f3f41
data/Rakefile CHANGED
@@ -18,6 +18,10 @@ require "bundler/gem_tasks"
18
18
 
19
19
  require "rake/testtask"
20
20
 
21
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
22
+ load "rails/tasks/engine.rake"
23
+ load "rails/tasks/statistics.rake"
24
+
21
25
  Rake::TestTask.new(:test) do |t|
22
26
  t.libs << "test"
23
27
  t.pattern = "test/**/*_test.rb"
@@ -29,9 +29,10 @@ module Noticed
29
29
  new(params)
30
30
  end
31
31
 
32
- def param(name)
33
- param_names.push(name)
32
+ def params(*names)
33
+ param_names.concat Array.wrap(names)
34
34
  end
35
+ alias param params
35
36
  end
36
37
 
37
38
  def initialize(params = {})
@@ -2,7 +2,13 @@ module Noticed
2
2
  class Coder
3
3
  def self.load(data)
4
4
  return if data.nil?
5
- ActiveJob::Arguments.send(:deserialize_argument, JSON.parse(data))
5
+
6
+ # Text columns need JSON parsing
7
+ if data.is_a?(String)
8
+ data = JSON.parse(data)
9
+ end
10
+
11
+ ActiveJob::Arguments.send(:deserialize_argument, data)
6
12
  end
7
13
 
8
14
  def self.dump(data)
@@ -16,11 +16,19 @@ module Noticed
16
16
  end
17
17
 
18
18
  def channel
19
- if (method = options[:channel])
20
- notification.send(method)
21
- else
22
- Noticed::NotificationChannel
23
- end
19
+ @channel ||= begin
20
+ value = options[:channel]
21
+ case value
22
+ when String
23
+ value.constantize
24
+ when Symbol
25
+ notification.send(value)
26
+ when Class
27
+ value
28
+ else
29
+ Noticed::NotificationChannel
30
+ end
31
+ end
24
32
  end
25
33
  end
26
34
  end
@@ -13,7 +13,7 @@ module Translation
13
13
 
14
14
  def scope_translation_key(key)
15
15
  if key.to_s.start_with?(".")
16
- "notifications.#{self.class.name.underscore}#{key}"
16
+ "#{i18n_scope}.#{self.class.name.underscore}#{key}"
17
17
  else
18
18
  key
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module Noticed
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noticed
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-06 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails