notifications 0.4.4 → 0.5.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: 79db559c211b2011d5615a2ac349e6d36abf5ec76c61bb2fcb08db013d5ced50
4
- data.tar.gz: cffba71597d27b35f00357c9a743645a9c276b673acc618214084110f0f46c75
3
+ metadata.gz: 11ede6b9c4999b3fcd16cd1b416ec02495e69ed62f47cc1f129d86f790b89535
4
+ data.tar.gz: 63d585ba260dea8f79369779fc5f288f1e2fcff9af827646aee1c83c7608f993
5
5
  SHA512:
6
- metadata.gz: '0998a62dd596d90afcdc6289d4a54195f00ad39c782ef31e503f4263cd94309c5ce1660651f48a6686bf50749449f71cda01b6902bd1a8d0a2c2224f211385eb'
7
- data.tar.gz: 754e36beeb1b439e4acaa89f7c651e36f21f884cac0a628ba3b081691abe92e9c23bac0955b787e2d60be463efa586f454162c44a14bb346af5b854988b617da
6
+ metadata.gz: 85a919e22548ae611bbf54b2bb61b8e2f1831ea2226e97950797d7b6dbc74689633d0da71dcdfa25df16870772d11a994df76fdd30c8a002912b480951c74d2b
7
+ data.tar.gz: 3328313f4fb47bc3805d93b5fb5f9dd7fc3ad8fad0ece1141128474729e0cad2ac6aeafcaf102edbcf9351be819d603bce4f9f580c22866aa892a5067790ab3a
@@ -1,4 +1,4 @@
1
- class CreateNotifications < ActiveRecord::Migration[5.0]
1
+ class CreateNotifications < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :notifications do |t|
4
4
  t.integer :user_id, null: false
@@ -5,12 +5,21 @@ module Notifications
5
5
  DEFAULT_AVATAR = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAMAAAAJixmgAAAAFVBMVEWkpKSnp6eqqqq3t7fS0tLV1dXZ2dmshcKEAAAAtklEQVR4Ae3XsRGAAAjAQFRk/5HtqaTz5H+DlInvAQAAAAAAAAAAAAAAAAAAAACymiveO6o7BQsWLFiwYMGCBS8PFixYsGDBggULFixYsGDBggULFixYsGDBggULFixYsGDBc4IFCxYsWLBgwYIFC14ZfOeAPRQ8IliwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQv+JQAAAAAAAAAAAAAAAAAAAOAB4KJfdHmj+kwAAAAASUVORK5CYII='
6
6
 
7
7
  included do
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
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
14
23
 
15
24
  scope :unread, -> { where(read_at: nil) }
16
25
  end
@@ -1,3 +1,3 @@
1
1
  module Notifications
2
- VERSION = '0.4.4'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-23 00:00:00.000000000 Z
11
+ date: 2018-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.2.0
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
26
  version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency