socialization 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +3 -4
- data/CHANGELOG.md +6 -0
- data/README.md +7 -3
- data/lib/socialization/stores/active_record/follow.rb +2 -2
- data/lib/socialization/stores/active_record/like.rb +2 -2
- data/lib/socialization/stores/active_record/mention.rb +2 -2
- data/lib/socialization/stores/redis/base.rb +2 -2
- data/lib/socialization/version.rb +1 -1
- metadata +49 -67
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 39b3c656c408687fa0ee59c6290a726c06cc99d9
|
4
|
+
data.tar.gz: 04842d1fba2aefd0d43a4196493cfd466de10f6a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a0d79112e37012c0efe43a47f75a03b6b5a727b79c22ab70bbdb89d0d37bc55ca55e932f7c3552043eb33080d1fa0e5fb5f0c7fb74393966524dd7b172804ffd
|
7
|
+
data.tar.gz: d63f0418b794e48c4bed540fa096cfe886ba85f3db61fe7eb5eceadd03536a2ef422e722fa2f62774dc56049df99da97febad6c4529541d7eafd5ed7bd49b54f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.1 (January 8, 2014)
|
4
|
+
|
5
|
+
* Supports Rails 4 (thanks @thomas88)
|
6
|
+
* Dropping official support for Ruby 1.8.x, 1.9.2.
|
7
|
+
|
8
|
+
|
3
9
|
## 1.0.0 (May 29, 2013)
|
4
10
|
|
5
11
|
* Same as 0.5.0.beta4. Been using it in a very high traffic production environment for over a year and it works.
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ The Mention feature was written with Facebook mentions in mind. For example, Joh
|
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
15
|
-
### Rails 3
|
15
|
+
### Rails 3/4
|
16
16
|
|
17
17
|
Add the gem to the gemfile:
|
18
18
|
`gem "socialization"`
|
@@ -115,6 +115,10 @@ Is following?
|
|
115
115
|
|
116
116
|
user.follows?(celebrity)
|
117
117
|
|
118
|
+
What items are you following (given that an Item model is followed)?
|
119
|
+
|
120
|
+
user.followees(Item)
|
121
|
+
|
118
122
|
|
119
123
|
***
|
120
124
|
|
@@ -186,7 +190,7 @@ Toggle
|
|
186
190
|
Mentions?
|
187
191
|
|
188
192
|
comment.mentions?(user)
|
189
|
-
|
193
|
+
|
190
194
|
All mentionees
|
191
195
|
|
192
196
|
comment.mentionees(User)
|
@@ -246,4 +250,4 @@ To use the demo app:
|
|
246
250
|
|
247
251
|
## Copyright
|
248
252
|
|
249
|
-
Copyright (c) 2012 Carl Mercier -- Released under the MIT license.
|
253
|
+
Copyright (c) 2012-2014 Carl Mercier -- Released under the MIT license.
|
@@ -66,7 +66,7 @@ module Socialization
|
|
66
66
|
def followers(followable, klass, opts = {})
|
67
67
|
rel = followers_relation(followable, klass, opts)
|
68
68
|
if rel.is_a?(ActiveRecord::Relation)
|
69
|
-
rel.
|
69
|
+
rel.to_a
|
70
70
|
else
|
71
71
|
rel
|
72
72
|
end
|
@@ -92,7 +92,7 @@ module Socialization
|
|
92
92
|
def followables(follower, klass, opts = {})
|
93
93
|
rel = followables_relation(follower, klass, opts)
|
94
94
|
if rel.is_a?(ActiveRecord::Relation)
|
95
|
-
rel.
|
95
|
+
rel.to_a
|
96
96
|
else
|
97
97
|
rel
|
98
98
|
end
|
@@ -66,7 +66,7 @@ module Socialization
|
|
66
66
|
def likers(likeable, klass, opts = {})
|
67
67
|
rel = likers_relation(likeable, klass, opts)
|
68
68
|
if rel.is_a?(ActiveRecord::Relation)
|
69
|
-
rel.
|
69
|
+
rel.to_a
|
70
70
|
else
|
71
71
|
rel
|
72
72
|
end
|
@@ -92,7 +92,7 @@ module Socialization
|
|
92
92
|
def likeables(liker, klass, opts = {})
|
93
93
|
rel = likeables_relation(liker, klass, opts)
|
94
94
|
if rel.is_a?(ActiveRecord::Relation)
|
95
|
-
rel.
|
95
|
+
rel.to_a
|
96
96
|
else
|
97
97
|
rel
|
98
98
|
end
|
@@ -66,7 +66,7 @@ module Socialization
|
|
66
66
|
def mentioners(mentionable, klass, opts = {})
|
67
67
|
rel = mentioners_relation(mentionable, klass, opts)
|
68
68
|
if rel.is_a?(ActiveRecord::Relation)
|
69
|
-
rel.
|
69
|
+
rel.to_a
|
70
70
|
else
|
71
71
|
rel
|
72
72
|
end
|
@@ -92,7 +92,7 @@ module Socialization
|
|
92
92
|
def mentionables(mentioner, klass, opts = {})
|
93
93
|
rel = mentionables_relation(mentioner, klass, opts)
|
94
94
|
if rel.is_a?(ActiveRecord::Relation)
|
95
|
-
rel.
|
95
|
+
rel.to_a
|
96
96
|
else
|
97
97
|
rel
|
98
98
|
end
|
@@ -11,7 +11,7 @@ module Socialization
|
|
11
11
|
result
|
12
12
|
end
|
13
13
|
else
|
14
|
-
actors_relation(victim, klass, options).
|
14
|
+
actors_relation(victim, klass, options).to_a
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -32,7 +32,7 @@ module Socialization
|
|
32
32
|
result
|
33
33
|
end
|
34
34
|
else
|
35
|
-
victims_relation(actor, klass, options).
|
35
|
+
victims_relation(actor, klass, options).to_a
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
metadata
CHANGED
@@ -1,144 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 1.0.0
|
4
|
+
version: 1.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Carl Mercier
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-08 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
|
-
none: false
|
21
|
-
name: activerecord
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
23
|
requirements:
|
26
|
-
- -
|
24
|
+
- - ">="
|
27
25
|
- !ruby/object:Gem::Version
|
28
26
|
version: '0'
|
29
|
-
none: false
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
|
-
|
28
|
+
name: appraisal
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
32
30
|
requirements:
|
33
|
-
- -
|
31
|
+
- - ">="
|
34
32
|
- !ruby/object:Gem::Version
|
35
33
|
version: '0'
|
36
|
-
none: false
|
37
|
-
name: appraisal
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
37
|
requirements:
|
42
|
-
- -
|
38
|
+
- - ">="
|
43
39
|
- !ruby/object:Gem::Version
|
44
40
|
version: '0'
|
45
|
-
none: false
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
|
-
|
42
|
+
name: logger
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
48
44
|
requirements:
|
49
|
-
- -
|
45
|
+
- - ">="
|
50
46
|
- !ruby/object:Gem::Version
|
51
47
|
version: '0'
|
52
|
-
none: false
|
53
|
-
name: logger
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
|
-
- -
|
52
|
+
- - ">="
|
59
53
|
- !ruby/object:Gem::Version
|
60
54
|
version: '0'
|
61
|
-
none: false
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
|
-
|
56
|
+
name: mocha
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
|
-
- -
|
59
|
+
- - ">="
|
66
60
|
- !ruby/object:Gem::Version
|
67
61
|
version: '0'
|
68
|
-
none: false
|
69
|
-
name: mocha
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
65
|
requirements:
|
74
|
-
- -
|
66
|
+
- - ">="
|
75
67
|
- !ruby/object:Gem::Version
|
76
68
|
version: '0'
|
77
|
-
none: false
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
|
-
|
70
|
+
name: shoulda
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
80
72
|
requirements:
|
81
|
-
- -
|
73
|
+
- - ">="
|
82
74
|
- !ruby/object:Gem::Version
|
83
75
|
version: '0'
|
84
|
-
none: false
|
85
|
-
name: shoulda
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
79
|
requirements:
|
90
|
-
- -
|
80
|
+
- - ">="
|
91
81
|
- !ruby/object:Gem::Version
|
92
82
|
version: '0'
|
93
|
-
none: false
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
|
-
|
84
|
+
name: sqlite3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
96
86
|
requirements:
|
97
|
-
- -
|
87
|
+
- - ">="
|
98
88
|
- !ruby/object:Gem::Version
|
99
89
|
version: '0'
|
100
|
-
none: false
|
101
|
-
name: sqlite3
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
93
|
requirements:
|
106
|
-
- -
|
94
|
+
- - ">="
|
107
95
|
- !ruby/object:Gem::Version
|
108
96
|
version: '0'
|
109
|
-
none: false
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
|
-
|
98
|
+
name: yard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
112
100
|
requirements:
|
113
|
-
- -
|
101
|
+
- - ">="
|
114
102
|
- !ruby/object:Gem::Version
|
115
103
|
version: '0'
|
116
|
-
none: false
|
117
|
-
name: yard
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- -
|
108
|
+
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '0'
|
125
|
-
none: false
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
|
-
|
112
|
+
name: mock_redis
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
|
-
- -
|
115
|
+
- - ">="
|
130
116
|
- !ruby/object:Gem::Version
|
131
117
|
version: '0'
|
132
|
-
none: false
|
133
|
-
name: mock_redis
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
121
|
requirements:
|
138
|
-
- -
|
122
|
+
- - ">="
|
139
123
|
- !ruby/object:Gem::Version
|
140
124
|
version: '0'
|
141
|
-
none: false
|
142
125
|
description: Socialization allows any model to Follow and/or Like any other model.
|
143
126
|
This is accomplished through a double polymorphic relationship on the Follow and
|
144
127
|
Like models. But you don't need to know that since all the complexity is hidden
|
@@ -148,8 +131,8 @@ executables: []
|
|
148
131
|
extensions: []
|
149
132
|
extra_rdoc_files: []
|
150
133
|
files:
|
151
|
-
- .gitignore
|
152
|
-
- .travis.yml
|
134
|
+
- ".gitignore"
|
135
|
+
- ".travis.yml"
|
153
136
|
- Appraisals
|
154
137
|
- CHANGELOG.md
|
155
138
|
- Gemfile
|
@@ -281,27 +264,26 @@ files:
|
|
281
264
|
- test/world_test.rb
|
282
265
|
homepage: https://github.com/cmer/socialization
|
283
266
|
licenses: []
|
267
|
+
metadata: {}
|
284
268
|
post_install_message:
|
285
269
|
rdoc_options: []
|
286
270
|
require_paths:
|
287
271
|
- lib
|
288
272
|
required_ruby_version: !ruby/object:Gem::Requirement
|
289
273
|
requirements:
|
290
|
-
- -
|
274
|
+
- - ">="
|
291
275
|
- !ruby/object:Gem::Version
|
292
276
|
version: '0'
|
293
|
-
none: false
|
294
277
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
295
278
|
requirements:
|
296
|
-
- -
|
279
|
+
- - ">="
|
297
280
|
- !ruby/object:Gem::Version
|
298
281
|
version: '0'
|
299
|
-
none: false
|
300
282
|
requirements: []
|
301
283
|
rubyforge_project:
|
302
|
-
rubygems_version: 1.
|
284
|
+
rubygems_version: 2.1.0
|
303
285
|
signing_key:
|
304
|
-
specification_version:
|
286
|
+
specification_version: 4
|
305
287
|
summary: Easily socialize your app with Likes and Follows
|
306
288
|
test_files:
|
307
289
|
- test/actors/follower_test.rb
|