socialization 2.0.0 → 2.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22d8b3559cb4bc0d9138ea45753f7fab5f06ba44f1b583da221612c9c3a596c6
|
4
|
+
data.tar.gz: 14465566e6b73fd7f4fe8d815f09987e3f4468d7e98a250fdb74e1f0a1b63f08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3f1d7f31abb85b30943294d1b270eeca7f190ba4317e379c0f7fd4c8756b94d59a0204553d8462e781fdb6f331f448e3e565febe4c7099d32845fe9cc6c0741
|
7
|
+
data.tar.gz: 80ca7caf02ab9062200b1d521fcf7e8f463aa25097a988c2cea0f0f64f732f6943855043340c1b8a54dab80cc1c491be0ca95c125aff6707758483e6260ff41a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,6 +9,7 @@ The Like feature works just like a Facebook Like. For example, John likes Pulp F
|
|
9
9
|
The Mention feature was written with Facebook mentions in mind. For example, John mentions Jane in a comment. Typically, Jane would be highlighted in the comment user interface and possibly notified that John mentioned her. This Facebook feature is occasionally called Tagging, although tagging is generally something [entirely different](http://en.wikipedia.org/wiki/Tag_(metadata).
|
10
10
|
|
11
11
|
![Specs](https://github.com/cmer/socialization/actions/workflows/specs.yml/badge.svg)
|
12
|
+
[![Gem Version](https://badge.fury.io/rb/socialization.svg)](https://badge.fury.io/rb/socialization)
|
12
13
|
|
13
14
|
## Installation
|
14
15
|
|
@@ -9,12 +9,12 @@ module Socialization
|
|
9
9
|
belongs_to :followable, :polymorphic => true
|
10
10
|
|
11
11
|
scope :followed_by, lambda { |follower| where(
|
12
|
-
:follower_type => follower.class.
|
12
|
+
:follower_type => follower.class.name.classify,
|
13
13
|
:follower_id => follower.id)
|
14
14
|
}
|
15
15
|
|
16
16
|
scope :following, lambda { |followable| where(
|
17
|
-
:followable_type => followable.class.
|
17
|
+
:followable_type => followable.class.name.classify,
|
18
18
|
:followable_id => followable.id)
|
19
19
|
}
|
20
20
|
|
@@ -54,7 +54,7 @@ module Socialization
|
|
54
54
|
def followers_relation(followable, klass, opts = {})
|
55
55
|
rel = klass.where(klass.primary_key =>
|
56
56
|
self.select(:follower_id).
|
57
|
-
where(:follower_type => klass.
|
57
|
+
where(:follower_type => klass.name.classify).
|
58
58
|
where(:followable_type => followable.class.to_s).
|
59
59
|
where(:followable_id => followable.id)
|
60
60
|
)
|
@@ -75,7 +75,7 @@ module Socialization
|
|
75
75
|
def followables_relation(follower, klass, opts = {})
|
76
76
|
rel = klass.where(klass.primary_key =>
|
77
77
|
self.select(:followable_id).
|
78
|
-
where(:followable_type => klass.
|
78
|
+
where(:followable_type => klass.name.classify).
|
79
79
|
where(:follower_type => follower.class.to_s).
|
80
80
|
where(:follower_id => follower.id)
|
81
81
|
)
|
@@ -9,12 +9,12 @@ module Socialization
|
|
9
9
|
belongs_to :likeable, :polymorphic => true
|
10
10
|
|
11
11
|
scope :liked_by, lambda { |liker| where(
|
12
|
-
:liker_type => liker.class.
|
12
|
+
:liker_type => liker.class.name.classify,
|
13
13
|
:liker_id => liker.id)
|
14
14
|
}
|
15
15
|
|
16
16
|
scope :liking, lambda { |likeable| where(
|
17
|
-
:likeable_type => likeable.class.
|
17
|
+
:likeable_type => likeable.class.name.classify,
|
18
18
|
:likeable_id => likeable.id)
|
19
19
|
}
|
20
20
|
|
@@ -54,7 +54,7 @@ module Socialization
|
|
54
54
|
def likers_relation(likeable, klass, opts = {})
|
55
55
|
rel = klass.where(klass.primary_key =>
|
56
56
|
self.select(:liker_id).
|
57
|
-
where(:liker_type => klass.
|
57
|
+
where(:liker_type => klass.name.classify).
|
58
58
|
where(:likeable_type => likeable.class.to_s).
|
59
59
|
where(:likeable_id => likeable.id)
|
60
60
|
)
|
@@ -75,7 +75,7 @@ module Socialization
|
|
75
75
|
def likeables_relation(liker, klass, opts = {})
|
76
76
|
rel = klass.where(klass.primary_key =>
|
77
77
|
self.select(:likeable_id).
|
78
|
-
where(:likeable_type => klass.
|
78
|
+
where(:likeable_type => klass.name.classify).
|
79
79
|
where(:liker_type => liker.class.to_s).
|
80
80
|
where(:liker_id => liker.id)
|
81
81
|
)
|
@@ -9,12 +9,12 @@ module Socialization
|
|
9
9
|
belongs_to :mentionable, :polymorphic => true
|
10
10
|
|
11
11
|
scope :mentioned_by, lambda { |mentioner| where(
|
12
|
-
:mentioner_type => mentioner.class.
|
12
|
+
:mentioner_type => mentioner.class.name.classify,
|
13
13
|
:mentioner_id => mentioner.id)
|
14
14
|
}
|
15
15
|
|
16
16
|
scope :mentioning, lambda { |mentionable| where(
|
17
|
-
:mentionable_type => mentionable.class.
|
17
|
+
:mentionable_type => mentionable.class.name.classify,
|
18
18
|
:mentionable_id => mentionable.id)
|
19
19
|
}
|
20
20
|
|
@@ -54,7 +54,7 @@ module Socialization
|
|
54
54
|
def mentioners_relation(mentionable, klass, opts = {})
|
55
55
|
rel = klass.where(klass.primary_key =>
|
56
56
|
self.select(:mentioner_id).
|
57
|
-
where(:mentioner_type => klass.
|
57
|
+
where(:mentioner_type => klass.name.classify).
|
58
58
|
where(:mentionable_type => mentionable.class.to_s).
|
59
59
|
where(:mentionable_id => mentionable.id)
|
60
60
|
)
|
@@ -75,7 +75,7 @@ module Socialization
|
|
75
75
|
def mentionables_relation(mentioner, klass, opts = {})
|
76
76
|
rel = klass.where(klass.primary_key =>
|
77
77
|
self.select(:mentionable_id).
|
78
|
-
where(:mentionable_type => klass.
|
78
|
+
where(:mentionable_type => klass.name.classify).
|
79
79
|
where(:mentioner_type => mentioner.class.to_s).
|
80
80
|
where(:mentioner_id => mentioner.id)
|
81
81
|
)
|