notifications 0.5.0 → 0.6.0

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: 11ede6b9c4999b3fcd16cd1b416ec02495e69ed62f47cc1f129d86f790b89535
4
- data.tar.gz: 63d585ba260dea8f79369779fc5f288f1e2fcff9af827646aee1c83c7608f993
3
+ metadata.gz: cba82d59d143b6411bffc9075d57c62da33109df3bb44258b6748c4c25fe85b4
4
+ data.tar.gz: 923fada5c2102c30d43f637ccd450401d6b51eae40be6a1a09ced2e70c2738d9
5
5
  SHA512:
6
- metadata.gz: 85a919e22548ae611bbf54b2bb61b8e2f1831ea2226e97950797d7b6dbc74689633d0da71dcdfa25df16870772d11a994df76fdd30c8a002912b480951c74d2b
7
- data.tar.gz: 3328313f4fb47bc3805d93b5fb5f9dd7fc3ad8fad0ece1141128474729e0cad2ac6aeafcaf102edbcf9351be819d603bce4f9f580c22866aa892a5067790ab3a
6
+ metadata.gz: 916a13099e241528a0094eb57f674854edcc6dd25b140c4c1aebadbfa5dd31fd1a5a53b977018edad204b1376151c03aba6b66866fcdf9ef92235ed34a632de3
7
+ data.tar.gz: e727c786778533d599303e61ad23583d8e7c2ea9255465b48ea54d664a81a9d4997eac77542c9cb1d7b9cb9d3b4239e0bbb6f7fb4a9e026cf2185a75115a0987
data/README.md CHANGED
@@ -11,8 +11,10 @@ Mountable notifications for any Rails applications.
11
11
  ## Installation
12
12
 
13
13
  ```ruby
14
- # Gemfile
15
- gem 'notifications'
14
+ # Gemfile Rails ~> 5
15
+ gem 'notifications', '~> 0.6.0'
16
+ # Gemfile for Rails ~> 4.2
17
+ gem 'notifications', '~> 0.5.0'
16
18
  ```
17
19
 
18
20
  And then run `bundle install`.
@@ -101,7 +103,13 @@ It is recommended that you use [second_level_cache](https://github.com/hooopo/se
101
103
 
102
104
  ## Contributing
103
105
 
104
- Contribution directions go here.
106
+ Testing for multiple Rails versions:
107
+
108
+ ```bash
109
+ make test_51
110
+ # or test all
111
+ make test
112
+ ```
105
113
 
106
114
  ## Site Used
107
115
 
@@ -1,4 +1,4 @@
1
- class CreateNotifications < ActiveRecord::Migration
1
+ class CreateNotifications < ActiveRecord::Migration[5.0]
2
2
  def change
3
3
  create_table :notifications do |t|
4
4
  t.integer :user_id, null: false
@@ -5,21 +5,12 @@ module Notifications
5
5
  DEFAULT_AVATAR = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAMAAAAJixmgAAAAFVBMVEWkpKSnp6eqqqq3t7fS0tLV1dXZ2dmshcKEAAAAtklEQVR4Ae3XsRGAAAjAQFRk/5HtqaTz5H+DlInvAQAAAAAAAAAAAAAAAAAAAACymiveO6o7BQsWLFiwYMGCBS8PFixYsGDBggULFixYsGDBggULFixYsGDBggULFixYsGDBc4IFCxYsWLBgwYIFC14ZfOeAPRQ8IliwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQv+JQAAAAAAAAAAAAAAAAAAAOAB4KJfdHmj+kwAAAAASUVORK5CYII='
6
6
 
7
7
  included do
8
- if Rails.version.start_with? "4"
9
- belongs_to :actor, class_name: Notifications.config.user_class
10
- belongs_to :user, class_name: Notifications.config.user_class
11
-
12
- belongs_to :target, polymorphic: true
13
- belongs_to :second_target, polymorphic: true
14
- belongs_to :third_target, polymorphic: true
15
- else
16
- belongs_to :actor, class_name: Notifications.config.user_class, optional: true
17
- belongs_to :user, class_name: Notifications.config.user_class
18
-
19
- belongs_to :target, polymorphic: true, optional: true
20
- belongs_to :second_target, polymorphic: true, optional: true
21
- belongs_to :third_target, polymorphic: true, optional: true
22
- end
8
+ belongs_to :actor, class_name: Notifications.config.user_class, optional: true
9
+ belongs_to :user, class_name: Notifications.config.user_class
10
+
11
+ belongs_to :target, polymorphic: true, optional: true
12
+ belongs_to :second_target, polymorphic: true, optional: true
13
+ belongs_to :third_target, polymorphic: true, optional: true
23
14
 
24
15
  scope :unread, -> { where(read_at: nil) }
25
16
  end
@@ -1,3 +1,3 @@
1
1
  module Notifications
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0
19
+ version: '5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.0
26
+ version: '5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: kaminari
29
29
  requirement: !ruby/object:Gem::Requirement